I was making a controller while the server default localhost:8000 for laravel was on.
After making the controller the server was not working and when i tried command "php artisan serve" in terminal it gave me :-
[Symfony\Component\Debug\Exception\FatalErrorException]
parse error
What Should i do to make my project run again ?
I found out that it was due to a Syntax Error which can be found out by:
To search for syntax errors, go to your project directory and try linting the entire directory by running this command:
Command Here:-
If any syntax errors are present, the command will output the first file that has an error, the line where it occurs and the error message.
artisan
commands will stop working when you've got this type of error somewhere in the app. Just find it (it seems there is one in a new controller), fix it and it will work.
Another thing to add to other answers, is to add -v
to the artisan
command you are using. This gives you a nice back trace, which helps finding possible bugs.
Like php artisan -v serve