php - Laravel route parameter in AppServiceProvider -


i have following route:

route::get('{organisation}', 'organisation\homecontroller@index'); 

now need {organisation} in appserviceprovider code there follows:

view()->composer('organisation.layout', function($view) {         $view->with('categories', categoryhelper::getcategoriesbyorganisation($organisation)); }); 

$organisation has become route parameter. need have categories available in view time.

i've tried input::get('organisation'); no luck.

is best approach? if yes, how route parameter?

try this

\app::make('request')->route()->getparameter('organisation') 

is best approach. depends on doing.

if loading categories organisation when viewing organization should fine.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -