Skip to content

Conversation

@bilfeldt
Copy link

Adding a note to the API section about First-Party UI Initiated Requests for applications using laravel/ui for authentication instead of Sanctum. This includes a code example for policies to be compatible with Laravel Nova.

Adding a note to the API section about _First-Party UI Initiated Requests_ for applications using `laravel/ui` for authentication instead of Sanctum. This includes a code example for policies to be compatible with Laravel Nova.
Fix spelling error of `defaults`
@taylorotwell
Copy link
Member

Set your nova.guard configuration option to sanctum in your config/nova.php configuration file.

@bilfeldt
Copy link
Author

@taylorotwell awesome 👍 I did not even find this option until I searched the sanctum source code upon seeing your comment.

Of cause it also works simply changing the default guard in config/auth.php

/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/

'defaults' => [
    'guard' => 'sanctum', // originally 'web'
    'passwords' => 'users',
],

Might I ask @taylorotwell if we should not either

  1. default new Laravel installations with Jetstream to use sanctum as default guard
  2. or document this guard in either sanctum or Jetstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants