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

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -