In Lumen, I can do this in my blade template:
{{ url('/css/app.css') }}
In Laravel I could do
{{ asset('/css/app.css') }}
Is the url helper all I have to work with in Lumen?
Had the same problem, moving from laravel to lumen. As @hieu-le says, I made an asset helper as below.
if (!function_exists('urlGenerator')) { /** * @return LaravelLumenRoutingUrlGenerator */ function urlGenerator() { return new LaravelLumenRoutingUrlGenerator(app()); } } if (!function_exists('asset')) { /** * @param $path * @param bool $secured * * @return string */ function asset($path, $secured = false) { return urlGenerator()->asset($path, $secured); } }
1.4m articles
1.4m replys
5 comments
57.0k users