meetingRepository = $meetingRepository; $this->employeeRepository = $employeeRepository; $this->clientRepository = $clientRepository; } public function index() { $data['title'] = 'Meeting Lists'; $data['meetingLists'] = $this->meetingRepository->findAll(); return view('meeting::meeting.index', $data); } /** * Show the form for creating a new resource. */ public function create() { $data['title'] = 'Create Meeting'; $data['editable'] = false; $data['memberList'] = $this->employeeRepository->pluck(); $data['clientList'] = $this->clientRepository->pluck(); return view('meeting::meeting.create', $data); } /** * Store a newly created resource in storage. */ public function store(Request $request): RedirectResponse { try { $this->meetingRepository->create($request->all()); toastr()->success('Meeting created successfully'); } catch (\Throwable $th) { toastr()->error($th->getMessage()); } return redirect()->route('meeting.index'); } /** * Show the specified resource. */ public function show($id) { $data['title'] = 'Meeting Details'; $data['item'] = $this->meetingRepository->getMeetingById($id); return view('meeting::meeting.show', $data); } /** * Show the form for editing the specified resource. */ public function edit($id) { $data['title'] = 'Edit Leave'; $data['editable'] = true; $data['meeting'] = $this->meetingRepository->getMeetingById($id); return view('meeting::edit', $data); } /** * Update the specified resource in storage. */ public function update(Request $request, $id): RedirectResponse { $inputData = $request->except(['_method', '_token']); $this->meetingRepository->update($id, $inputData); toastr()->success('Meeting Updated Succesfully'); return redirect()->route('meeting.index'); } /** * Remove the specified resource from storage. */ public function destroy($id) { $this->meetingRepository->delete($id); toastr()->success('Meeting Deleted Succesfully'); } }