/** * Prompts the user to download the specified uploaded file. * * @param int|string $id * @param int|string $manualId * * @return \Symfony\Component\HttpFoundation\BinaryFileResponse */ public function download($id, $manualId) { $asset = $this->asset->find($id); $manual = $asset->manuals()->find($manualId); if ($manual) { return response()->download($manual->download_path); } abort(404); }
/** * Prompts the user to download the specified uploaded file. * * @param int|string $id * @param int|string $imageId * * @return \Symfony\Component\HttpFoundation\BinaryFileResponse */ public function download($id, $imageId) { $asset = $this->asset->find($id); $image = $asset->images()->find($imageId); if ($image) { return response()->download($image->download_path); } abort(404); }
/** * Displays all work orders available to be attached to the specified asset. * * @param int|string $assetId * * @return \Illuminate\View\View */ public function attach($assetId) { $asset = $this->asset->find($assetId); return view('assets.work-orders.attach.index', compact('asset')); }