Od wersji Laravel 5.7.28
, Możesz po prostu skonfigurować w 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',
],
],