The User inherits from the EloquentModel class. in the framework of lumen5.3, the code {code...} in the phpstorm framework reports an error in phpstorm: {code...} the all method is correct. If I change the framework to lumen5.0.3, this error will not be reported. Is the framework method changed? what should I do in lumen5.3? the User inherits from the EloquentModel class. in the framework of lumen5.3, the code below the phpstorm framework
public function view($id){ User::all(); User::find($id); return User::findOrFail($id);}
Phpstorm error:
Method 'find' not found in \App\UserMethod 'findOrFail' not found in \App\User。
The all method is fine.
If I change the framework to lumen 5.0.3, this error will not be reported.
Is the framework method changed? what should I do in lumen5.3.
Reply content:
The User inherits from the EloquentModel class. in the framework of lumen5.3, the code below the phpstorm framework
public function view($id){ User::all(); User::find($id); return User::findOrFail($id);}
Phpstorm error:
Method 'find' not found in \App\UserMethod 'findOrFail' not found in \App\User。
The all method is fine.
If I change the framework to lumen 5.0.3, this error will not be reported.
Is the framework method changed? what should I do in lumen5.3.
Have you read this article? it seems you want to use Eloquent to enable it separately?
If you want to use Eloquent ORM, cancelbootstrap/app.php
File$app->withEloquent()
Comments before the call.