-
Notifications
You must be signed in to change notification settings - Fork 416
Description
I'm trying to use app('url')->asset() in my view but i get these errors:
#1
ErrorException in UrlGenerator.php line 159:
Undefined property: Laravel\Lumen\Routing\UrlGenerator::$forceSchema (View: /home/agree/Documents/project/monitoring-pembelajaran/resources/views/layout.blade.php)
I fixed #1 by adding force schema property:
protected $forceSchema
But i get another error:
#2
ErrorException in UrlGenerator.php line 161:
Undefined property: Laravel\Lumen\Routing\UrlGenerator::$request (View: /home/agree/Documents/project/monitoring-pembelajaran/resources/views/layout.blade.php)
I fixed #2 by changing line 161 from this:
return $this->forceSchema ?: $this->request->getScheme().'://';
to this:
return $this->forceSchema ?: $this->app->make('request')->getScheme().'://';
Seems no further error.