casteRepository = $casteRepository; } /** * Display a listing of the resource. */ public function index() { $data['title'] = 'Caste List'; $data['casteLists'] = $this->casteRepository->findAll(); return view('admin::castes.index', $data); } /** * Show the form for creating a new resource. */ public function create() { $data['title'] = 'Create Caste'; $data['editable'] = false; return view('admin::castes.create', $data); } /** * Store a newly created resource in storage. */ public function store(Request $request): RedirectResponse { $this->casteRepository->create($request->all()); return redirect()->route('caste.index'); } /** * Show the specified resource. */ public function show($id) { return view('admin::castes.show'); } /** * Show the form for editing the specified resource. */ public function edit($id) { $data['title'] = 'Edit Caste'; $data['editable'] = true; $data['caste'] = $this->casteRepository->getCasteById($id); return view('admin::castes.edit', $data); } /** * Update the specified resource in storage. */ public function update(Request $request, $id): RedirectResponse { $this->casteRepository->update($id, $request->all()); return redirect()->route('caste.index'); } /** * Remove the specified resource from storage. */ public function destroy($id) { // } }