php - Model Class not found error -


using laravel 5.4, getting error on view whenever call method shows on screen

(1/1) fatalthrowableerror class 'app\models\chat\user' not found 

hierarchy of project :

controllers     - chatmessagecontroller models    -chat         -message.php    -user.php 

and here's controller class code :

namespace app\http\controllers\chat;  use app\http\controllers\controller; use app\models\chat\message; use app\models\user; use illuminate\http\request;   class chatmessagecontroller extends controller {     public function index()     {       $messages = message::with(['user'])->latest()->limit(100)->get();       return response()->json($messages,200);     } } 

in message.php, forgot add: use app\models\user;.

so, trying find user in wrong space.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -