当前位置: 首页>>代码示例>>PHP>>正文


PHP Storage::has方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Storage::has方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::has方法的具体用法?PHP Storage::has怎么用?PHP Storage::has使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Storage的用法示例。


在下文中一共展示了Storage::has方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: download

 public function download(Request $request, $original_filename)
 {
     $entry = FileEntry::where('original_filename', '=', $original_filename)->firstOrFail();
     if (Storage::has($request->user()->id . '/' . $entry->original_filename)) {
         $file = Storage::get($request->user()->id . '/' . $entry->original_filename);
         return (new Response($file, 200))->header('Content-Description', 'File Transfer')->header('Content-Type', $entry->mime)->header('Content-Disposition', 'attachment; filename=' . $entry->original_filename)->header('Content-Transfer-Encoding', 'binary')->header('Connection', 'Keep-Alive')->header('Expires', 0)->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')->header('Pragma', 'public')->header('Content-Length', $entry->size);
         // ->header('Content-Type', $entry->mime);
     }
     $sys_notifications[] = array('type' => 'danger', 'message' => 'O arquivo não existe!');
     $request->session()->flash('sys_notifications', $sys_notifications);
     return back()->withInput($request->all());
 }
开发者ID:system3d,项目名称:consultas-tecnicas,代码行数:12,代码来源:FileEntryController.php

示例3: filenameExists

 private function filenameExists($filename)
 {
     return Storage::has('laramanager/images/' . $filename);
 }
开发者ID:philsquare,项目名称:laramanager,代码行数:4,代码来源:UniqueFilenameValidator.php

示例4: destroyFile

 protected function destroyFile($filenamePath)
 {
     if (Storage::has($filenamePath)) {
         Storage::delete($filenamePath);
     }
 }
开发者ID:philsquare,项目名称:laramanager,代码行数:6,代码来源:Uploader.php

示例5: getAvatarSmallLinkAttribute

 public function getAvatarSmallLinkAttribute()
 {
     if (Storage::has('contact/' . $this->id . '/avatar.png')) {
         return "<img src='" . url('avatar/' . $this->id) . "' class='img-circle' style='height: 75px; padding:5px;'>";
     } else {
         if ($this->is_deceased) {
             return "<img src='" . url('img/dead.png') . "' class='img-circle' style='height: 75px; padding:5px;'>";
         } else {
             return "<img src='" . url('img/default.png') . "' class='img-circle' style='height: 75px; padding:5px;'>";
         }
     }
 }
开发者ID:arborrow,项目名称:montserrat,代码行数:12,代码来源:Contact.php

示例6: getRetreatEvaluationsLinkAttribute

 public function getRetreatEvaluationsLinkAttribute()
 {
     if (Storage::has('event/' . $this->id . '/evaluations.pdf')) {
         $img = Html::image('img/evaluation.png', 'Evaluations', array('title' => "Evaluations"));
         $link = '<a href="' . url('retreat/' . $this->id . '/evaluations" ') . 'class="btn btn-default" style="padding: 3px;">' . $img . '</a>';
         return $link;
     } else {
         return NULL;
     }
 }
开发者ID:arborrow,项目名称:montserrat,代码行数:10,代码来源:Retreat.php

示例7: getImagePath

 /**
  * Returns full image path from given filename
  *
  * @param  string $filename
  * @return string
  */
 private function getImagePath($filename)
 {
     // find file
     foreach (config('imagecache.paths') as $path) {
         // don't allow '..' in filenames
         $image_path = $path . '/' . str_replace('..', '', $filename);
         if (file_exists($image_path) && is_file($image_path)) {
             // file found
             return file_get_contents($image_path);
         }
     }
     //find file with Storage
     if (Storage::has('images/' . $filename)) {
         $image_path = Storage::get('images/' . $filename);
         return $image_path;
     }
     // file not found
     abort(404);
 }
开发者ID:kyle-dinh,项目名称:imagecache,代码行数:25,代码来源:ImageCacheController.php


注:本文中的Illuminate\Support\Facades\Storage::has方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。