如何在Laravel中调试错误,如意外';'

I have started learning Laravel from last few days and during the course I keep getting errors like

unexpected ';'

below is the detailed error

FatalErrorException in 
home/ubuntu/workspace/storage/framework/views/d54ff8380f369dc8c9bc785ef2c17d66e0f399b3.php line 10: syntax error, 
unexpected ';'

Though I was able to find the cause of the error, which was again because of one typographical mistake in one of my view file i.e. create.blade.php .

My question is how to debug similar kind of error in large projects as error don't points out the exact file-name where syntax error was happening though the line number mentioned was the correct one ?

Please do let me know if I am not clear in my above question.

P.S. I checked the logs as well and it says the same thing.

Thanks in advance, Sambhav

Well, this error is difficult to find when you are starting with laravel, or even worst, when you have kilometers in laravel but have a tons of view compiled at the same layout.

Generally this errors comes when you put a semicolon in blade syntax like this:

@if($something == true)
    // code here
@endif;

See the semicolon at endif? well, that breaks laravel's view. Another classic is:

@lang('app.hello');

or

@endforeach;

You need to review in that keywords if it has semicolon at the end. What I do sometimes is to call the views individually to isolate the error, it is easiest to find the error when you find the view in concrete. Why laravel does not display the current line number in the view where the errors is jumping? This is because laravel at first place compile blade syntax into html file, this file is cached to increase response's speed. So, laravel will compile even types like these exists;