Download the PHP package setiawanhu/sanctum-auth without Composer
On this page you can find all versions of the php package setiawanhu/sanctum-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sanctum-auth
Laravel sanctum-auth Package
Laravel package for generating user authentication feature using Laravel Sanctum
For information & usage about Laravel Sanctum, please refer to Laravel Sanctum documentation.
Get Started
Include the Sanctum Auth package by calling this composer command in project root:
Note: This package is only supporting Laravel 9
Usage
We may publish the Sanctum Auth migration files using vendor:publish
artisan command:
This command will copy the user role's migration file to /database/migrations folder and will publish the laravel/sanctum
configuration and migration files.
Then, run Sanctum Auth artisan command by running:
This command will generate the auth routing out of the box.
Note:
-
The
type
argument is optional with default value aretoken
. The controller will be generated based on given argument value. Available types aretoken
andspa
. - The
--force
option is optional. We may use it for ignoring existing controller.
Then, make User
model to extend AuthModel
class:
Using Roles
if the User
has roles, we may use the HasRole
trait to the User
model:
Then, we add a new field to the users table:
Then, run the database migration command:
Dig Deeper
Please check wiki for more details about sanctum-auth usage
All versions of sanctum-auth with dependencies
laravel/sanctum Version ^2.0
illuminate/support Version ^7.0|^8.0
illuminate/database Version ^7.0|^8.0
php Version ^7.2|^8.0