当前位置: 首页>>代码示例>>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;未经允许,请勿转载。