There was the same problem, moving from laravel to lumen. As @ hieu-le said, I made a helper helper as shown below.
if (!function_exists('urlGenerator')) { function urlGenerator() { return new \Laravel\Lumen\Routing\UrlGenerator(app()); } } if (!function_exists('asset')) { function asset($path, $secured = false) { return urlGenerator()->asset($path, $secured); } }
Murwa source share