Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel cache

/** Clear all cache Laravel **/
php artisan route:clear && php artisan view:clear && php artisan config:clear && php artisan cache:clear && php artisan clear-compiled
Comment

laravel cache

Cache::put('key', 'value', $seconds);
Cache::rememberForever('users', function () {
    return DB::table('users')->get();
}); 
Cache::get('key');
Cache::has('key');
Cache::pull('key');
Comment

laravel cache

// i am using laravel versioin 8  so...... 
// use this in ur controller then
use IlluminateSupportFacadesCache;
// in function 
Cache::put('key', 'value', 1440);// 1 day
Cache::get('key');
Cache::has('key');
Cache::pull('key');
Cache::forget('key');// remove spacific
Cache::flush(); // remove  all
Comment

why the laravel project have many cache

1 _  go to app/console/Kernel.php
2 _ do everything that you want in schedule like this : 

protected function schedule(Schedule $schedule)
    {
        $schedule->call(function () {
            DB::table('recent_users')->delete();
        })->daily();
    }
Comment

laravel use cache

use IlluminateSupportFacadesCache;
Comment

PREVIOUS NEXT
Code Example
Php :: stripe php sdk constants 
Php :: create config value file in php 
Php :: rodar migration laravel 
Php :: php print string as bytes 
Php :: laravel longblob migration 
Php :: laravel FacadesDB update 
Php :: install spatie for role and permissions 
Php :: Get PHP String Length 
Php :: Use external variable in array_filter 
Php :: array random php 
Php :: unnamed place placeholders pdo 
Php :: Uncaught Error: Call to undefined function add_submenu_page() 
Php :: php estrutura basica 
Php :: limit wordpress search to title 
Php :: send data with href 
Php :: phpspreadsheet select sheet 
Php :: Invalid datetime format: 1366 Incorrect string value 
Php :: using laravel passport with mongodb 
Php :: find auth laravel 
Php :: php call non static method from static method 
Php :: php file_put_contents 
Php :: php get parent url from script location 
Php :: laravel sprintf span in controller 
Php :: get month name php 
Php :: laravel collection shift 
Php :: laravel guard 
Php :: php if null then 0 
Php :: submit form and show results on same page without refresh 
Php :: update to php 7.4 
Php :: pass data to blade laravel 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =