Skip to content

Commit

Permalink
Merge pull request #134 from tuandm/bugfix/issue-133-migration-after-…
Browse files Browse the repository at this point in the history
…applying-passport

Fix migrations after applying Laravel passport
  • Loading branch information
tuandm authored Mar 11, 2020
2 parents ab65927 + 299813c commit a6ca69f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/Laravue/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
class Permission extends \Spatie\Permission\Models\Permission
{
public $guard_name = 'api';

/**
* To exclude permission management from the list
*
Expand Down
2 changes: 2 additions & 0 deletions app/Laravue/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
class Role extends \Spatie\Permission\Models\Role
{
public $guard_name = 'api';

/**
* Check whether current role is admin
* @return bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class SetupRolePermissions extends Migration
public function up()
{
foreach (Acl::roles() as $role) {
Role::findOrCreate($role, 'api');
Role::findOrCreate($role);
}

$adminRole = Role::findByName(Acl::ROLE_ADMIN);
$managerRole = Role::findByName(Acl::ROLE_MANAGER);
$editorRole = Role::findByName(Acl::ROLE_EDITOR);
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use App\Laravue\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use Spatie\Permission\Models\Role;
use App\Laravue\Models\Role;

class DatabaseSeeder extends Seeder
{
Expand Down

0 comments on commit a6ca69f

Please sign in to comment.