how to change api_token column in token guard

前端 未结 2 1580
庸人自扰
庸人自扰 2021-01-12 08:22

Laravel 5.5

I want to change direction of api token that used in TokenGaurd so, i created a custom guard named CafeTokenGau

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-12 08:45

    Since the version Laravel 5.7.28, You can simply set up in config/auth.php.

    'guards' => [
        'api' => [
            'driver' => 'token',
            'input_key' => 'token',   // The input name to pass through
            'storage_key' => 'token', // The column name to store in database
            'provider' => 'users',
        ],
    ],
    

提交回复
热议问题