I got an error when I created a directory called List in Laravel
Thank you for your continued support.
This article contains advertisements that help fund our operations.
Table Of Contents
⇨ Click here for the table of contents of Laravel articles
The main error message this time is here:
syntax error, unexpected 'List' (T_LIST), expecting identifier (T_STRING)
Conclusion
As the title suggests, the cause was creating a controller in a directory named List.
Since it is already used elsewhere, let's avoid using List.
The sequence of events that led to the error is as follows:
php artisan make:controller List/SearchController
I created a directory called List and a controller like this.
Then this error occurred.
Countermeasure
Let's change it to Lists! or something (lol)
php artisan make:controller Lists/SearchController
Summary
That's it.
For feedback or complaints, please contact me via Twitter DM.
See you!
Popular Articles
Deploying PHP7.4 + Laravel6 project to AWS EC2
Implementing breadcrumbs in Laravel with laravel-breadcrumbs