Diploma Front End Demo of Spatie installation repo: https://github.com/Robbo-lab/spatie-permission-demo Spatie Permission Docs: https://spatie.be/docs/laravel-permission/v6/installation-laravel
Basic installation, role assignment and model attachment(articles)
Permission assignment route
Role assignment route
-
Open Laragon and Start Services:
- Start Apache/Nginx and MySQL from the Laragon interface.
-
Open Terminal in Laragon:
- Click on Terminal in Laragon to open the command prompt in the Laragon environment.
-
Create Laravel Project:
composer create-project --prefer-dist laravel/laravel spatie-permission-demo
-
Set up Environment File:
- Navigate to the project folder:
cd spatie-permission-demo
- Copy
.env.example
to.env
:cp .env.example .env
- Generate an application key:
php artisan key:generate
- Open
.env
and configure your database settings.
- Navigate to the project folder:
-
Create a Database in Laragon:
- Open phpMyAdmin in Laragon.
- Create a database named
spatie_permission_demo
.
-
Run Migrations:
- Run the initial migrations to set up Laravel’s default tables.
php artisan migrate
- Run the initial migrations to set up Laravel’s default tables.
-
Install Sanctum for API-based authentication:
composer require laravel/sanctum
-
Publish Sanctum configuration and run migrations:
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider" php artisan migrate