PHP 클래스 Spatie\Permission\Models\Role

상속: extends Illuminate\Database\Eloquent\Model, use trait Spatie\Permission\Traits\HasPermissions, use trait Spatie\Permission\Traits\RefreshesPermissionCache
파일 보기 프로젝트 열기: spatie/laravel-permission 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$guarded array The attributes that aren't mass assignable.

공개 메소드들

메소드 설명
__construct ( array $attributes = [] ) Create a new Eloquent model instance.
findByName ( string $name ) : Role Find a role by its name.
hasPermissionTo ( string | Spatie\Permission\Models\Permission $permission ) : boolean Determine if the user may perform the given permission.
permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany A role may be given various permissions.
users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany A role may be assigned to various users.

메소드 상세

__construct() 공개 메소드

Create a new Eloquent model instance.
public __construct ( array $attributes = [] )
$attributes array

findByName() 공개 정적인 메소드

Find a role by its name.
public static findByName ( string $name ) : Role
$name string
리턴 Role

hasPermissionTo() 공개 메소드

Determine if the user may perform the given permission.
public hasPermissionTo ( string | Spatie\Permission\Models\Permission $permission ) : boolean
$permission string | Spatie\Permission\Models\Permission
리턴 boolean

permissions() 공개 메소드

A role may be given various permissions.
public permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
리턴 Illuminate\Database\Eloquent\Relations\BelongsToMany

users() 공개 메소드

A role may be assigned to various users.
public users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
리턴 Illuminate\Database\Eloquent\Relations\BelongsToMany

프로퍼티 상세

$guarded 공개적으로 프로퍼티

The attributes that aren't mass assignable.
public array $guarded
리턴 array