當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Storage::delete方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Storage::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Storage::delete方法的具體用法?PHP Storage::delete怎麽用?PHP Storage::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Storage的用法示例。


在下文中一共展示了Storage::delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: excluir

 public function excluir($id)
 {
     $this->post = Post::where('id', $id)->first();
     Storage::delete($this->post->id . '.jpg');
     $this->post->delete();
     return redirect()->route('dashboard');
 }
開發者ID:edilsonribeiro,項目名稱:etec.palmital.quati,代碼行數:7,代碼來源:PostController.php

示例2: retrieveFile

 public function retrieveFile(Submission $submissions, $file)
 {
     $form = $submissions->formdefinition()->first();
     if ($submissions->group()->users()->get()->contains(Auth::user())) {
         //$file = Storage::get("form/".$form->id."/".$file);
         $filepath = "form/" . $form->id . "/" . $file;
         //Storage::get(form/)
         // if(Storage::exists($filepath)){
         /* if(copy($filepath,"/var/www/calwebtool/public/downloads/".$file)){
                    return respones()->file("downloads/".$file);
                }
                //Storage::copy($filepath,"downloads/".$file);
                return response()->file("downloads/".$file);
            //}
            /*else{
                flash()->overlay("The file does not exist.","Not Found");
                return redirect()->back();
            }*/
         if (Storage::exists($filepath)) {
             if (Storage::exists("downloads/" . $file)) {
                 Storage::delete("downloads/" . $file);
             }
             Storage::copy($filepath, "downloads/" . $file);
             return response()->download("downloads/" . $file);
         }
     }
 }
開發者ID:kcattakcaz,項目名稱:CALwebtool,代碼行數:27,代碼來源:SubmissionController.php

示例3: destroyFile

 /**
  * Destroy file
  * Path is relative to /app directory
  *
  * @param $filenamepath
  */
 public function destroyFile($filenamepath)
 {
     if (Storage::has($filenamepath)) {
         return Storage::delete($filenamepath);
     }
     return true;
 }
開發者ID:philsquare,項目名稱:laraform,代碼行數:13,代碼來源:Files.php

示例4: delete

 /**
  * @param $id
  * @return array
  */
 public function delete($id)
 {
     $obj = $this->rep->find($id);
     if (Storage::exists($obj->id . '.' . $obj->extension)) {
         Storage::delete($obj->id . '.' . $obj->extension);
     }
     return parent::delete($id);
 }
開發者ID:ao-lab,項目名稱:laravel-manager,代碼行數:12,代碼來源:ArchiveService.php

示例5: excluir

 public function excluir($id)
 {
     $aviso = new Aviso();
     $aviso = Aviso::where('id', $id)->first();
     $aviso->delete();
     Storage::delete($aviso->id . 'aviso.jpg');
     return redirect()->route('avisos');
 }
開發者ID:edilsonribeiro,項目名稱:etec.palmital.quati,代碼行數:8,代碼來源:AvisoController.php

示例6: isFileExist

 protected function isFileExist()
 {
     $oe = $this->info->containmentAction->objective_evidence;
     if ($this->isNotEmpty($this->info->containmentAction) && $this->isExist($this->directory($oe))) {
         Storage::delete($this->directory($oe));
     }
     return $this;
 }
開發者ID:rob1121,項目名稱:qdn,代碼行數:8,代碼來源:cna.php

示例7: delete

 public function delete($filename, $isLocal = false)
 {
     if ($isLocal) {
         File::delete(storage_path('app') . '/' . config('images.path') . $filename);
     } else {
         Storage::delete(config('images.path') . $filename);
     }
 }
開發者ID:B1naryStudio,項目名稱:asciit,代碼行數:8,代碼來源:ImageService.php

示例8: deleteFile

 public function deleteFile($id)
 {
     $pf = $this->repository->find($id);
     $filename = $pf->name . "." . $pf->extension;
     if (Storage::exists($filename) && $this->delete($id)) {
         return Storage::delete($filename);
     }
     return true;
 }
開發者ID:riczat,項目名稱:anglar,代碼行數:9,代碼來源:ProjectFileService.php

示例9: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     $configPath = __DIR__ . '/config/connectionloader.php';
     $migrationPath = __DIR__ . '/migration/2016_05_02_000000_create_connection_loader_table.php';
     /**
      * Copy the default configuration file and migration file when user runs php artisan vendor:publish
      */
     $this->publishes([$configPath => config_path('/connectionloader.php')], 'config');
     $this->publishes([$migrationPath => database_path('/migrations/2016_05_02_000000_create_connection_loader_table.php')], 'migration');
     if ($this->app['config']->get('connectionloader.enabled')) {
         if (!$this->app['config']->get('connectionloader.enabled')) {
             return;
         }
         $connection = $this->app['config']->get('connectionloader.connection');
         $table = $this->app['config']->get('connectionloader.table');
         $check = $this->app['config']->get('connectionloader.check_enabled');
         if (!(isset($connection) && isset($table) && isset($check))) {
             \error_log('Invalid connection or table specified in configuration file');
             return;
         }
         /**
          * Function to gather database connections from database and table provided
          * in configuration file. Compiles into file that returns an array.
          * Function returns path to the temporary file.
          */
         $fileName = ConnectionLoader::getConnections($connection, $table);
         if ($fileName == null) {
             \error_log('Error in returned file name value');
             return;
         }
         $file_path = storage_path('app/' . $fileName);
         /**
          * Merge the returned configuration array into the existing database.connections
          * configuration key.
          */
         $key = 'database.connections';
         $config = $this->app['config']->get($key, []);
         $configSet = $this->app['config']->set($key, array_merge(require $file_path, $config));
         /**
          * Now to delete the temporary file created during the process
          */
         $result = Storage::delete($fileName);
         if ($result === false) {
             \error_log('Failed to delete ' . storage_path() . $fileName);
             \error_log('Trying once more');
             $result = Storage::delete($fileName);
             if ($result === true) {
                 \error_log(storage_path() . $fileName . ' Deleted successfully');
                 return;
             }
             \error_log('Failed to delete twice, delete manually ' . storage_path() . $fileName);
             return;
         }
         ConnectionLoader::checkConnections($connection, $table, $check);
     }
 }
開發者ID:laralabs,項目名稱:connection-loader,代碼行數:61,代碼來源:ConnectionLoaderServiceProvider.php

示例10: postEliminar

 public function postEliminar()
 {
     $id = Input::get('id');
     $medio = Input::get('medio');
     if (Storage::exists($medio)) {
         Storage::delete($medio);
     }
     Medio::find(Input::get('id'))->fill(Input::all())->delete();
     return response()->json(["mensaje" => "eliminado"]);
 }
開發者ID:3JSoluciones,項目名稱:cafesdelhuila,代碼行數:10,代碼來源:MediosController.php

示例11: deleteApoyo

 public function deleteApoyo($filename)
 {
     $archivo = $this->descargar($filename);
     $exists = Storage::disk('local')->exists($archivo->filename);
     if ($exists) {
         Storage::delete($archivo->filename);
         $archivo->delete();
         flash()->overlay('Ha sido borrado sactifactoriamente', 'El archivo ' . $archivo->filename);
     }
 }
開發者ID:jgt,項目名稱:ceprog,代碼行數:10,代碼來源:ApoyoRepository.php

示例12: borrar

 public function borrar($filename)
 {
     $archivo = Fileentry::where('filename', '=', $filename)->firstOrFail();
     $exists = Storage::disk('local')->exists($archivo->filename);
     if ($exists) {
         Storage::delete($archivo->filename);
         $archivo->delete();
         flash()->overlay('Ha sido borrado sactifactoriamente', 'El archivo ' . $archivo->filename);
     }
 }
開發者ID:jgt,項目名稱:ceprog,代碼行數:10,代碼來源:FileentryRepository.php

示例13: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     // IF there is a previously uploaded award image file, delete it
     if (Session::has('award_image_upload')) {
         Storage::delete(storage_path('app\\uploads') . '\\' . Session::get('award_image_upload'));
         Session::delete('award_image_upload');
     }
     $award = Award::findOrFail($id);
     return view('award.edit')->with('award', $award);
 }
開發者ID:sonja-turo,項目名稱:wwiionline-awards,代碼行數:16,代碼來源:AwardController.php

示例14: destroy

 public function destroy($id)
 {
     $store = Store::find($id);
     if ($store->file_entries_id !== 0) {
         $entry = FileEntry::find($store->file_entries_id);
         Storage::delete($entry->filename);
         $entry->delete();
     }
     $store->delete();
     return response()->json(['id' => $id]);
 }
開發者ID:Kangaroos,項目名稱:restart-reserve,代碼行數:11,代碼來源:StoreController.php

示例15: RemoveColumnAudioSample

 public function RemoveColumnAudioSample($syllabaryId, $columnId)
 {
     $column = SyllabaryColumnHeader::where('syllabary_id', '=', $syllabaryId)->where('id', '=', $columnId)->first();
     try {
         Storage::delete($column->audio_sample);
     } catch (\Exception $e) {
     }
     $column->audio_sample = null;
     $column->save();
     return redirect()->back();
 }
開發者ID:ChristopherCotnoir,項目名稱:Sequoyah,代碼行數:11,代碼來源:AudioController.php


注:本文中的Illuminate\Support\Facades\Storage::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。