Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel access request in provider

public function register()
{
    $this->app->bind('MyInterface', function () {
        $request = app(IlluminateHttpRequest::class);

        return app(MyImplementation::class, [$request->foo]);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #access #request #provider
ADD COMMENT
Topic
Name
2+6 =