middleware('auth', ['except' => ['index', 'show']]); } public function index() { $customer_log_statuses = CustomerLogStatus::paginate(); return view('customer_log_statuses.index', compact('customer_log_statuses')); } public function show(CustomerLogStatus $customer_log_status) { return view('customer_log_statuses.show', compact('customer_log_status')); } public function create(CustomerLogStatus $customer_log_status) { return view('customer_log_statuses.create_and_edit', compact('customer_log_status')); } public function store(Request $request): RedirectResponse { $customer_log_status = CustomerLogStatus::create($request->all()); return redirect()->route('customer_log_statuses.show', $customer_log_status->id)->with('message', 'Created successfully.'); } public function edit(CustomerLogStatus $customer_log_status) { $this->authorize('update', $customer_log_status); return view('customer_log_statuses.create_and_edit', compact('customer_log_status')); } public function update(Request $request, CustomerLogStatus $customer_log_status) { $this->authorize('update', $customer_log_status); $customer_log_status->update($request->all()); return redirect()->route('customer_log_statuses.show', $customer_log_status->id)->with('message', 'Updated successfully.'); } public function destroy(CustomerLogStatus $customer_log_status) { $this->authorize('destroy', $customer_log_status); $customer_log_status->delete(); return redirect()->route('customer_log_statuses.index')->with('message', 'Deleted successfully.'); } }