Welcome Guest, Not a member yet? Register   Sign In
Route with http verb
#1

Hi,
This may have been answered, but as the forum search is not working I need to ask.

I am trying to redirect to a page with parameters, but not sure how to configure the redirect, the route or even if the route is necessary.

Essentially I am trying to replicate the following http://mydomain/mypage/mymethod?weekending='something' in the redirect, i.e.

PHP Code:
return redirect()->route('named_route/weekending/25-10-2020'); 


And assuming my route would look something like
PHP Code:
$routes->post('named_route/varName/varValue''myPage::myMethod/parameters'); 

which would interact with my controller
PHP Code:
class myPage extends BaseController {
    
    public function 
index() {
    
         
//This does something
    }

    
    public function 
myMethod() {
    
        if(
$this->request->getGetPost('weekending')) {
            
            
//this does something else    
            
            
}else{
            return redirect()->route('404');
            }
    }

Reply


Messages In This Thread
Route with http verb - by 68thorby68 - 10-13-2020, 01:52 AM
RE: Route with http verb - by 68thorby68 - 10-14-2020, 04:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB