PHP code example of nawasara / core
1. Go to this page and download the library: Download nawasara/core 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/ */
nawasara / core example snippets
use Nawasara\Core\Traits\RespectsActiveRole;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasRoles, RespectsActiveRole {
RespectsActiveRole::hasPermissionTo insteadof HasRoles;
}
}
bash
composer vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan migrate
php artisan db:seed --class="Nawasara\Core\Database\Seeders\PermissionSeeder" --force