Below is my code to get all users and role info for each user.
$Users = \App\Models\User\User_Model::all()
->with("Role")->get();
return view("User.List", array("Users" => $Users));
In my user model, A function is defined like below.
public function Role()
{
$this->hasOne("\App\Models\User\Role_Model", "RoleID");
}
I am getting below error
Method with does not exist.
Question ? Am I missing anything ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire