Running artisan db:seed finishes with: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given
Use some config/xxx.php file with instruction calling asset:
'name' => '<img src="' . asset('images/some.png') . '" width="20"> XYZ',
Laravel will work correctly, however artisan will crash with the above mentioned error.
Hey there,
Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.
Thanks!
asset() helper can't be used in config file.
@driesvints Still the same issue occurs on Laravel v7.25.0 (reproduction is the same as the one mentioned by OP).
asset()helper can't be used inconfigfile.
This seems to be the problem. I am able to reproduce the issue in Laravel v7.
@driesvints can you confirm if this is a bug / expected behaviour?
@shahalpk
You can override config value in AppServiceProvider.
public function boot()
{
config([
'xxx.value' => '<img src="' . asset('images/some.png') . '" width="20"> XYZ'
]);
}
@shahalpk expected
@driesvints okie. but shouldn't the error message be more meaningful?
Most helpful comment
asset()helper can't be used inconfigfile.