Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot use positional argument after named argument error in web.php

Route::get(uri: 'scraper', ["App\Http\Controllers\ScraperController"::class, 'scraper'])->name(name:'scraper');

I wrote this line in web.php, then I got this error:

‘Cannot use positional argument after named argument’

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You’re attempting to define routes using named arguments when it’s not necessary. You should write the following:

Route::get('scraper', ["App\Http\Controllers\ScraperController"::class, 'scraper'])->name('scraper');

You can read more about named arguments and how they differ from positional arguments.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading