assetDemandRepository = $assetDemandRepository; $this->assetRepository = $assetRepository; } /** * Display a listing of the resource. */ public function index() { $data['title'] = "AssetDemand Lists"; $data['assetDemandLists'] = $this->assetDemandRepository->findAll(); return view('asset::assetdemands.index', $data); } /** * Show the form for creating a new resource. */ public function create() { $data['title'] = "Create assetDemand"; $data['editable'] = false; $data['availableAssetLists'] = $this->assetRepository->pluckAvailable(); return view('asset::assetdemands.create', $data); } /** * Store a newly created resource in storage. */ public function store(Request $request): RedirectResponse { $this->assetDemandRepository->create($request->all()); toastr()->success('assetDemand Created Successfully.'); return redirect()->route('assetDemand.index'); } /** * Show the specified resource. */ public function show($id) { return view('asset::assetdemands.show'); } /** * Show the form for editing the specified resource. */ public function edit($id) { $data['title'] = "Edit assetDemand"; $data['editable'] = true; $data['assetDemand'] = $this->assetDemandRepository->getassetDemandById($id); return view('asset::assetdemands.edit', $data); } /** * Update the specified resource in storage. */ public function update(Request $request, $id): RedirectResponse { $this->assetDemandRepository->update($id, $request->all()); toastr()->success('assetDemand Updated Successfully.'); return redirect()->route('assetDemand.index'); } /** * Remove the specified resource from storage. */ public function destroy($id) { // } }