/** * Display a listing of the resource. * * @return Response */ public function index() { $host = MyS3Tool::getS3Path(); return view('admin.test')->withProduct(Product::find(8))->withHost($host); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $disk = Storage::disk('s3'); $product = Product::find($id); $server = MyS3Tool::getGlideServer(); $server->deleteCache($product->file_path); $disk->delete($product->file_path); $product->delete(); return Redirect::to('admin/products'); }