For example, there's a watch called ABC.
Structure for ID name time
I want to write a model (app/models/abc.php) inside there is a method called abc_db ()
function is to return the Id,name two column data of the ABC table
Then build a controller (app/http/controller/test/testcontroller.php)
How to call model in this file and implement Var_dump (abc_db () return data);
To find the above examples, thank you very much, I have not been the whole understanding, mainly eloquent
Reply content:
For example, there's a watch called ABC.
Structure for ID name time
I want to write a model (app/models/abc.php) inside there is a method called abc_db ()
function is to return the Id,name two column data of the ABC table
Then build a controller (app/http/controller/test/testcontroller.php)
How to call model in this file and implement Var_dump (abc_db () return data);
To find the above examples, thank you very much, I have not been the whole understanding, mainly eloquent
bank.php
belongsTo(User::class); } public static function getBankById($id){ return self::findOrFail($id); }}
homecontroller.php