Thursday, February 3, 2022

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

Issue

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.


Solution

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

<?php

namespace App\Models;


Answered By - Gayan

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.