Skip to content

UrlGenerator asset #131

@mpmaghribi

Description

@mpmaghribi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions