AppServiceProvider中的Laravel路由参数

I have the following route:

Route::get('{organisation}', 'Organisation\HomeController@index');

Now I need {organisation} in the AppServiceProvider my code there is as follows:

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

$organisation has to become the route parameter. I need to have categories available in the view all the time.

I've tried with Input::get('organisation'); but no luck.

Is this the best approach? If yes, how do I get the route parameter?

Try this

\App::make('request')->route()->getParameter('organisation')

Is this the best approach. It depends on what you are doing.

If you simply loading the categories by organisation when someone is viewing an organization this should do fine.