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

javascript - Create websocket without connecting -

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

android - Linear layout children not scrolling -