Answer the question
In order to leave comments, you need to log in
How to implement so that each user has his own added content?
There is a controller
Here is a piece of code
public function index()
{
if(Sentinel::inRole('manager')){
$us = User::where('id', Sentinel::getUser()->id)->get();
$companys = Company::where('user_id', Sentinel::getUser()->id)->get();
}else{
$us = User::get();
$companys = Company::get();
}
return view('auth.list', compact('us', 'companys'));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question