file('image')->store('public/offers'); $offer_photo = OfferPhoto::create([ 'file' => $image, ]); return new UploadImageResource($offer_photo); } public function deleteCatalog(int $id): void { $offer_photo = OfferPhoto::findOrFail($id); if (Storage::exists($offer_photo->file)) Storage::delete($offer_photo->file); $offer_photo->delete(); } }