Knowledge Base

Empty filter

Laravel Authentication

Authentication and User authorization in Laravel

1.composer create-project laravel/laravel example-app
cd example-app

1.1.
Install Composer 2 on your local machine.
Run the necessary commands (e.g., composer install) locally.
Upload the project, including the vendor directory, to the server.

2.composer require laravel/jetstream

3.php artisan jetstream:install livewire

4.php artisan migrate
4.1. npm install
npm run build

5.composer require spatie/laravel-permission

6.php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"

7.php artisan migrate

8.use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable {
use HasRoles;
// Other traits...
}

Published
Back to Index