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

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

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

StringGrid issue in Delphi XE8 firemonkey mobile app -