Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
dump(Cache::get('key')); // Всегда выводит Null if (!Cache::has('key')){ Cache::put('key', $values, 3600); dump(Cache::get('key')); // Выводит кешированные данные }
APP_ENV=local APP_DEBUG=true
APP_ENV=production APP_DEBUG=false
'default' => env('CACHE_DRIVER', 'file'),
php artisan optimize
а файл с кешом то создается?
php artisan tinker
php artisan tinker [ "default" => "array", "stores" => [ "apc" => [ "driver" => "apc", ], "array" => [ "driver" => "array", "serialize" => false, ], "database" => [ "driver" => "database", "table" => "cache", "connection" => null, "lock_connection" => null, ], "file" => [ "driver" => "file", "path" => "C:\OpenServer\domains\site.com\storage\framework/cache/data", ], "memcached" => [ "driver" => "memcached", "persistent_id" => null, "sasl" => [ null, null, ], "options" => [], "servers" => [ [ "host" => "127.0.0.1", "port" => 11211, "weight" => 100, ], ], ], "redis" => [ "driver" => "redis", "connection" => "cache", "lock_connection" => "default", ], "dynamodb" => [ "driver" => "dynamodb", "key" => "", "secret" => "", "region" => "us-east-1", "table" => "cache", "endpoint" => null, ], "octane" => [ "driver" => "octane", ], ], "prefix" => "laravel_cache_", ]