After I pull my project in git, I get this error. It's my 1st time to encounter this error.
The error is:
Namespace declaration statement has to be the very first statement or after any declare call in the script.
my Model
<?php
namespace App\Models;
The version of my Laravel is 5.5.
There is an empty space before the <?php
tag. Remove it.
<?php
namespace App\Models;
Also check that your IDE create UTF-8 files (with NO BOM) UTF-8 BOM. For example, in phpStorm Settings / Editor / File Encodings -> Create UTF-8 files: with NO BOM
If problem continue you have to remove bom from file via notepad++
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With