Fastest Web Hosting

passing data from a route to a controller laravel

0 votes
asked Nov 5, 2016 in Laravel by punnet (400 points)

I would like to pass a variable from my routes file to the controller specified. Not using parameters as the information is not in the URL. I can't figure out a way to pass it using the below code.

Route::get('faqs', [
    'as' => 'thing',
    'uses' => 'Controller@method',

Any thoughts?

1 Answer

0 votes
answered Nov 7, 2016 by anonymous

you can add like this

  Route::get('{name}', 'PublicareaController@companydetails');

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's