Reputation: 7787
I'm developing an app in Laravel 5.1. And for some reason there's loads of default namespace paths that are red (using PHPStorm 10). They are marked as "undefined namespace"
For example, when I make a model with artisan it ends up with this:
use Illuminate\Database\Eloquent\Model;
class Form extends Model
{
//
}
And Eloquent is red. So I can't use the model.
Same goes in app/config/app.php
Where Illuminate\Support\Facades\
where Facades is red.
These are tons of namespace errors like this (under the Illuminate root ). Any idea with it might be? See below...
Upvotes: 5
Views: 5449
Reputation: 105
In PhpStorm :
It worked for me.
Upvotes: 4
Reputation: 474
Try this:
Open setting-> (setting path in image) check "Synchronize IDE settings with composer.json"
Upvotes: 1
Reputation: 5047
When it happens to me, I place my cursor before use
and press enter.
Sometimes it fixes that.
Upvotes: 0
Reputation: 91
It's a problem of PHPSTORM. For those who have this problem, I resolve it by : - close phpstorm - remove the project folder .idea - create a new project with existing files.
It worked for me.
Upvotes: 7