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


PHP Cache::flush方法代码示例

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


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

示例1: editContent

 /**
  * Changes the content in About Us page as required
  * and returns to the admin's about us edit page.
  *
  * @param EditAboutUsRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function editContent(EditAboutUsRequest $request)
 {
     $img = $request->file('bannerImg');
     if ($img != null || $img != '') {
         $upload_path = public_path() . "/FrontEnd/img/about_us/";
         // for more on Laravel upload handling: http://clivern.com/how-to-create-file-upload-with-laravel/
         $img->move($upload_path, 'about_us2.jpg');
         // File Cache is cleared and rebuilt
         // Reason: Sometimes, even though the file has been changed, webpage displays the old file
         // even if it doesn't exist anymore. That nonexistant image comes from the file cache which is
         // used by Laravel to speedup web page loading speeds.
         Cache::flush();
     }
     if ($request->paragraph != null || $request->paragraph != '') {
         $content = $request->paragraph;
         $current_description = AboutUs::find(AboutUs::max('id'));
         if ($current_description == null) {
             $about_us = new AboutUs();
             $about_us->description = $content;
             $about_us->save();
         } else {
             $about_us = $current_description;
             $about_us->description = $content;
             $about_us->save();
         }
     }
     return redirect('admin_about_us')->with('status', 'About Us page was successfully updated.');
 }
开发者ID:nilesh93,项目名称:HOTEL_RESERVATION,代码行数:35,代码来源:AboutUsPageController.php

示例2: clearCache

 public function clearCache()
 {
     Cache::flush();
     Logs::add('process', trans('whole::http/controllers.tools_log_1'));
     Flash::success(trans('whole::http/controllers.tools_flash_1'));
     return redirect()->route('admin.index');
 }
开发者ID:phpspider,项目名称:core,代码行数:7,代码来源:ToolsController.php

示例3: clearCache

 public function clearCache()
 {
     Cache::flush();
     Logs::add('process', "Ön Bellek Temizlendi");
     Flash::success('Ön Bellek Başarıyla Temizlendi');
     return redirect()->route('admin.index');
 }
开发者ID:ringwoodinternet,项目名称:core,代码行数:7,代码来源:ToolsController.php

示例4: putAll

 /**
  * Handle permissions change
  *
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function putAll(Request $request)
 {
     $permissions = Permission::all();
     $input = array_keys($request->input('permissions'));
     try {
         DB::beginTransaction();
         $permissions->each(function ($permission) use($input) {
             if (in_array($permission->id, $input)) {
                 $permission->allow = true;
             } else {
                 $permission->allow = false;
             }
             $permission->save();
         });
         DB::commit();
         flash()->success(trans('permissions.save_success'));
     } catch (\Exception $e) {
         var_dump($e->getMessage());
         die;
         flash()->error(trans('permissions.save_error'));
     }
     try {
         Cache::tags(['permissions'])->flush();
     } catch (\Exception $e) {
         Cache::flush();
     }
     return redirect()->back();
 }
开发者ID:Denniskevin,项目名称:Laravel5Starter,代码行数:34,代码来源:AdminPermissionsController.php

示例5: getClear

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getClear()
 {
     // Cache::forget('settings');
     // Cache::forget('popular_categories');
     Cache::flush();
     return redirect()->back()->withSuccess('Cache Cleared!');
 }
开发者ID:ambarsetyawan,项目名称:brewski,代码行数:12,代码来源:CacheController.php

示例6: clearCache

 /**
  * Clear app cache.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function clearCache()
 {
     Cache::flush();
     Artisan::call('config:clear');
     Artisan::call('clear-html');
     Notification::success(trans('settings::global.Cache cleared') . '.');
     return redirect()->route('admin::index-settings');
 }
开发者ID:webfactorybulgaria,项目名称:Settings,代码行数:13,代码来源:AdminController.php

示例7: __construct

 public function __construct()
 {
     Cache::flush();
     //refresh elke keer voor development purpose...
     view()->share('euro', function ($number) {
         return number_format($number, 2, ',', '.');
     });
     view()->share('user', \Auth::user());
 }
开发者ID:nepp95,项目名称:economy,代码行数:9,代码来源:SharedController.php

示例8: updateSideBarCache

 public static function updateSideBarCache()
 {
     $categories = Category::all();
     $posts = Post::orderBy('updated_at', 'desc')->limit(2)->get();
     if (Cache::has('categories') || Cache::has('posts')) {
         Cache::flush();
     }
     Cache::forever('posts', compact('posts'));
     Cache::forever('categories', compact('categories'));
 }
开发者ID:shempignon,项目名称:laravel-5-blog-mvc,代码行数:10,代码来源:PostServiceProvider.php

示例9: flushCaches

 public function flushCaches()
 {
     Cache::flush();
     Session::flash('success', 'Les caches ont été effacés avec succès.');
     return redirect('admin');
 }
开发者ID:pierreboivin,项目名称:bgg_app,代码行数:6,代码来源:ToolsController.php

示例10: flushCache

 /**
  * Flush the users cache
  * 
  * @param \App\Models\User $user
  */
 public static function flushCache(User $user = null)
 {
     if ($user && $user->hasRole('admin')) {
         Cache::flush(['admin_users']);
     }
 }
开发者ID:ambarsetyawan,项目名称:Laravel5Starter,代码行数:11,代码来源:User.php

示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $teacher = Teacher::find($id);
     if (!$teacher) {
         return $this->response->errorNotFound('Teacher not found');
     }
     $teacher->delete();
     // Bad
     Cache::flush();
     // Better
     //Cache::tags('teacher-' . $id)->flush();
 }
开发者ID:t0ff3r,项目名称:LaravelAcademy,代码行数:18,代码来源:TeachersController.php

示例12: clear

 /**
  * Clears all cache data
  *
  * @example
  *          <code>
  *          //delete all cache
  *          mw()->cache->clear();
  *          </code>
  * @return boolean
  * @package Cache
  */
 public function clear()
 {
     return Cache::flush(true);
 }
开发者ID:hyrmedia,项目名称:microweber,代码行数:15,代码来源:LaravelCache.php

示例13: flush

 public function flush()
 {
     Cache::flush();
 }
开发者ID:samhoud,项目名称:eventbrite-plugin,代码行数:4,代码来源:EventbriteCache.php

示例14: getDeleteFavicon

 /**
  * Deletes favicon
  * 
  * @return Response
  */
 public function getDeleteFavicon()
 {
     Session::put('settings_tab', 'favicon');
     $path = public_path(Settings::getFavicon());
     file_exists($path) ? unlink($path) : null;
     Settings::where('param', 'favicon')->update(['value' => null]);
     Cache::flush('settings');
     flash()->success(trans('settings.favicon_deleted'));
     return redirect()->back();
 }
开发者ID:ambarsetyawan,项目名称:Laravel5Starter,代码行数:15,代码来源:AdminSettingsController.php

示例15: wipe

 /**
  * Flush entire cache.
  *
  * @author Morten Rugaard <moru@nodes.dk>
  * @return bool
  */
 public function wipe()
 {
     return IlluminateCache::flush();
 }
开发者ID:nodes-php,项目名称:cache,代码行数:10,代码来源:Repository.php


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