I am working on notifications I have 2 tables: one is notify
and the other is notify_status
. Through notify I am showing data like title
and description
and in notify_status
I have field read_status
which is by default 0
. After I show it I want to change it to 1
. I also have notify_id
in it as a foreign key. This is my show
method:
public function show($id)
{
$notify = Notify::find($id);
$notify_status = NotifyStatus::where('notify_id', $id)->get();
$user_data['read_status'] = 1;
$user = NotifyStatus::create($user_data);
return view('notify.desr')->with(compact('notify'));
}
But it isn't creating against notify_id
. What should I do?