7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravelで、Namespace declaration statement has to be the very first statement or after any declare call in the scriptってエラーが出た時の対策

7
Posted at

環境

Ubuntu 16.04.5 LTS (Xenial Xerus)
Laravel Framework 5.6.26

状況

普通にコントローラーを作っていて、エディタ上ではエラーがないのでサーバーを立ち上げてみると、
「Namespace declaration statement has to be the very first statement or after any declare call in the script」
とエラーが出ました。

ググったら、
・namespaceの上に何も書くな
・<?php の上に何も書くな
みたいなことが書いてあったのですが、自分のコードを見た感じ問題なさそうだったが、、、

僕の解決策

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?