$subjects, 'users' => $users, 'weekdays' => $weekdays]); } public function add_subject(Request $request) { $name = $request->input('name'); // $type = $request->input('type'); $weekday = $request->input('weekday'); $time = $request->input('time'); // $room_id = $request->input('room_id'); $user_id = $request->input('user_id'); Subject::create([ 'name' => $name, // 'type' => $type, 'weekday'=> $weekday, 'time' => $time, // 'room_id' => $room_id, 'user_id' => $user_id ]); return redirect(route('admin_subjects')); } public function delete_subject($subject_id) { Subject::find($subject_id)->delete(); return redirect(route('admin_subjects')); } public function edit_subject($subject_id) { Subject::find($subject_id); return redirect(route('admin_subjects')); } }