from the documentation I setup redis for the cache. But whenever I try hitting any end point, it gives me error for not ebing able to find the table cache in the database. I want only redis to be used not database but I’m not sure what else is missing in the configuration files.
These are the files I have. for instance in the config/database
<?php declare(strict_types=1);
return [
'default' =>'mysql',
'connections' => [
'mysql' => [ ... ],
],
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD'),
'port' => '6379'
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD'),
'port' => '6379',
],
],
];
in the config/cache.php I have the following:
<?php declare(strict_types=1);
return [
'default' => env('CACHE_STORE', 'redis'),
"driver" => env("CACHE_DRIVER", "redis"),
'stores' => [
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'redis'),
],
],
'prefix' => env('CACHE_PREFIX', 'MYT')
];
whenever I try to hit any endpoint I get the following error
{
"message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mytable.cache' doesn't exist (Connection: mysql, SQL: select * from `cache` where `key` = MYTilluminate:foundation:down limit 1)",
"exception": "Illuminate\Database\QueryException",
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
"line": 813,
"trace": [
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
"line": 767,
"function": "runQueryCallback",
"class": "Illuminate\Database\Connection",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
"line": 398,
"function": "run",
"class": "Illuminate\Database\Connection",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php",
"line": 2996,
"function": "select",
"class": "Illuminate\Database\Connection",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php",
"line": 2981,
"function": "runSelect",
"class": "Illuminate\Database\Query\Builder",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php",
"line": 3569,
"function": "Illuminate\Database\Query\{closure}",
"class": "Illuminate\Database\Query\Builder",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php",
"line": 2980,
"function": "onceWithColumns",
"class": "Illuminate\Database\Query\Builder",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php",
"line": 343,
"function": "get",
"class": "Illuminate\Database\Query\Builder",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php",
"line": 103,
"function": "first",
"class": "Illuminate\Database\Query\Builder",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Cache/Repository.php",
"line": 116,
"function": "get",
"class": "Illuminate\Cache\DatabaseStore",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Cache/Repository.php",
"line": 85,
"function": "get",
"class": "Illuminate\Cache\Repository",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Foundation/CacheBasedMaintenanceMode.php",
"line": 75,
"function": "has",
"class": "Illuminate\Cache\Repository",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
"line": 65,
"function": "active",
"class": "Illuminate\Foundation\CacheBasedMaintenanceMode",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php",
"line": 49,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Http\Middleware\HandleCors",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php",
"line": 57,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Http\Middleware\TrustProxies",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 119,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 175,
"function": "then",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 144,
"function": "sendRequestThroughRouter",
"class": "Illuminate\Foundation\Http\Kernel",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php",
"line": 1188,
"function": "handle",
"class": "Illuminate\Foundation\Http\Kernel",
"type": "->"
},
{
"file": "/projects/mytable/api2/public/index.php",
"line": 17,
"function": "handleRequest",
"class": "Illuminate\Foundation\Application",
"type": "->"
},
{
"file": "/projects/mytable/api2/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php",
"line": 23,
"function": "require_once"
}
]
}