Skip to content
Advertisement

laravel error : Namespace declaration statement has to be the very first statement or after any declare call in the script

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 AppModels;

The version of my Laravel is 5.5.

Advertisement

Answer

There is an empty space before the <?php tag. Remove it.

<?php

namespace AppModels;
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement