$this->deliveryRepository->getAllDeliveries() ]); } /** * Show the form for creating a new resource. */ public function create(): View { $this->authorize('create', Delivery::class); return view('deliveries.create'); } /** * Store a newly created resource in storage. */ public function store(DeliveryPostRequest $request): RedirectResponse { $this->authorize('create', Delivery::class); $this->deliveryRepository->createDelivery($request->validated()); return redirect()->route('deliveries.index'); } /** * Display the specified resource. */ public function show(Delivery $delivery): View { $this->authorize('view', $delivery); return view('deliveries.show', [ 'delivery' => $delivery, ]); } /** * Show the form for editing the specified resource. */ public function edit(Delivery $delivery): View { $this->authorize('update', $delivery); return view('deliveries.edit', [ 'delivery' => $delivery, ]); } /** * Update the specified resource in storage. */ public function update(DeliveryPostRequest $request, Delivery $delivery): RedirectResponse { $this->authorize('update', $delivery); $this->deliveryRepository->updateDelivery($delivery, $request->validated()); return redirect()->route('deliveries.index'); } /** * Remove the specified resource from storage. */ public function destroy(Delivery $delivery): RedirectResponse { $this->authorize('delete', $delivery); $this->deliveryRepository->deleteDelivery($delivery); return redirect()->route('deliveries.index'); } }