Answer the question
In order to leave comments, you need to log in
How to give access only to the user with his id and his data?
How on the page to make access only one user with his id and with his data?
Post::find(Auth::user()->id)
How to translate this to Sentinel
I don't understand a little here is the controller
public function store(Request $request){
$hom = new House;
$hom->description = $request->description;
$hom->country = $request->country;
$hom->region = $request->region;
$hom->street = $request->street;
$hom->nomer_doma = $request->nomer_doma;
$hom->user_id = Sentinel::getUser()->id;
$hom->save();
return redirect('/house');
}
public function index(){
$homs = House::all();
return view('house.index', compact('homs'));
}
public function create(){
return view('house.create');
}
Answer the question
In order to leave comments, you need to log in
$homs = House::where('user_id', Sentinel::getUser()->id)->get();
if (Sentinel::check()) {
$homs = House::where('user_id', Sentinel::getUser()->id)->get();
} else {
$homs = House::get();
}
Well, just like ReactJS, only, here's the question - were you going to write for iOS?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question