Monthly Archives: March 2020

laravel-permission

Official

https://github.com/spatie/laravel-permission

Doc

https://docs.spatie.be/laravel-permission/v3/basic-usage/role-permissions/

Model User

Config “Super Admin” in AuthServiceProvider.php

Controller and related functions

Add useful function in model User

Useful functions:

Check permission

https://docs.spatie.be/laravel-permission/v3/basic-usage/direct-permissions/

Use middeware

Trait for controller to use

Bugs

/vendor/spatie/laravel-permission/src/Traits/HasPermissions.php

 

Disable CSRF check for some route (page)

Reference:

Filter and Redirect Middleware

Middleware

Kernel

Route:

 

logg

 

Creating thumbs using Intervention\Image

 

Controller

Using Storage

 

Laravel Eloquent Auto Delete problem

Model

Controller: