PHP code example of budhaspec / rolepermission
1. Go to this page and download the library: Download budhaspec/rolepermission library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
budhaspec / rolepermission example snippets
php artisan migrate
php artisan vendor:publish --tag=public
use Budhaspec\Rolepermission\Models\Role;
Add 'role_id' in $fillable array.
Add below relationship.
public function role() {
return $this->belongsTo(Role::class, 'role_id');
}
php artisan serve