You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
443 B
16 lines
443 B
<?php |
|
|
|
namespace App\Models; |
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
use Illuminate\Database\Eloquent\Model; |
|
|
|
class Role extends \Spatie\Permission\Models\Role |
|
{ |
|
protected $guard = []; |
|
protected $guard_name = '*'; |
|
// guard_name = '*' 代表所有 guard 都可以使用這個 model |
|
// 這樣就不用在每次使用這個 model 時都要加上 guard_name |
|
// 例如: Role::where('name', 'Admin')->first(); |
|
|
|
}
|
|
|