It's easy to generate a URL as like Controller Action. Suppose you have a controller named "UserController" and have an action inside the Controller named "customerLogin" and in routes.php you mentioned the router as:
"Route::get("login_customer", "UserController@customerLogin"
So when you browse www.domain.com/login_customer then actually executed "customerLogin" action of "UserController".
Now for some reason you need to construct a URL based on Controller and Action, then you can apply below to generate URL:
Will generate below URL:
www.domain.com/login_customer?id=3+0
If you Controller exists inside another folder then you ca
action('Folder\UserController@customerLogin', ['id' => "3 0"])
No comments:
Post a Comment