php - Laravel: Call to a member function getParameter() on a non-object -


in appserviceprovider want set object ioc container like:

$organisation = organisationhelper::getorganisationbyslug(); $this->app->instance('organisation', $organisation); 

inside organisationhelper have following code:

$slug = \app::make('request')->route()->getparameter('organisation'); return organisation::select('id', 'name', 'slug')->where('slug', '=', $slug)->first(); 

the error i'm getting is: call member function getparameter() on non-object

it's because router has not been dispatched yet, don't know how fix or route parameter in other way.

any suggestions on how resolve route here?


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -