How to pass parameter in routes using controller in laravel?
You can just pass the parameter like this in your routes.php file
Route::get('company/{name}', array('as' => 'companydetails', 'uses' => 'PublicareaController@companydetails'));
And you need to add your controller this code like this:
public function companydetails($name)
{
echo $name;
die;
}
Route::get('company/{name}', array('as' => 'companydetails', 'uses' => 'PublicareaController@companydetails'));
And you need to add your controller this code like this:
public function companydetails($name)
{
echo $name;
die;
}
Comments
Post a Comment