Level 1
Use the lumen version with this https://github.com/laravel/lumen-framework/commit/1734696334595f8408d0a01061a7f8edc88367a3 patch and change use Illuminate\Contracts\Cache\Repository as Cache; by use Illuminate\Cache\Repository as Cache;.
I'm trying to use dependency injection in my class like this:
<?php
namespace App\Http\Controllers\Product;
use Illuminate\Database\DatabaseManager as DB;
use Illuminate\Cache\Repository as Cache;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class InventarioController extends Controller
{
protected $cache;
public function __construct(Cache $cache)
{
$this->cache = $cache;
}
}
But i get this error:
Argument 1 passed to App\Http\Controllers\Producto\InventarioController::__construct() must be an instance of Illuminate\Cache\Repository, instance of Illuminate\Cache\CacheManager given
I have added the alias to config/app.php like this:
$app->alias('cache', 'Illuminate\Cache\Repository');
Any idea why it throws me that error?
Please or to participate in this conversation.