使用委托时,如何修复Laravel badmethodcallexception



始终获得

  [BadMethodCallException]
  This cache store does not support tagging.

每当我尝试运行包含保存函数的数据库命令时,就会产生此错误,我认为是因为委托。

在寄存器controller上显示

的相同错误
  [BadMethodCallException]
  This cache store does not support tagging.

,但它仍然注册用户。都一样,但是代码的任何其他部分都停止了。我如何解决此错误。

<?php
namespace AppHttpControllersAuth;
use AppUser;
use AppHttpControllersController;
use IlluminateSupportFacadesValidator;
use IlluminateFoundationAuthRegistersUsers;
class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */
    use RegistersUsers;
    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }
    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return IlluminateContractsValidationValidator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:6|confirmed',
        ]);
    }
    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
}

注册控制器代码

在您的.env文件中设置CACHE_DRIVER=array

要纠正这一点,我完全从委托软件包中出来并创建一个新鲜

具有相同架构的角色权限模型和表格

当委托运行数据库迁移并使用Tinker填充数据。

接下来,我编辑了委托的中间件以查看我的角色,许可为 字符串

创建模型后。仅需 ZizacoEntrustMiddlewareEntrustRole即可删除爆炸函数。对于其他两个中间人

相关内容

  • 没有找到相关文章

最新更新