src/Defender/Traits/Permissions/RoleHasPermissions.php
public function permissions()
    {
        $permissionModel = config('defender.permission_model');
        $permissionRoleTable = config('defender.permission_role_table');
        $roleKey = config('defender.role_key');
        $permissionKey = config('defender.permission_key');

        return $this->belongsToMany($permissionModel, $permissionRoleTable, $roleKey, $permissionKey)->withPivot('value', 'expires');
    }
public function permissions()
    {
        $permissionModel = config('defender.permission_model');
        $permissionRoleTable = config('defender.permission_role_table');
        $roleKey = config('defender.role_key');
        $permissionKey = config('defender.permission_key');

        return $this->belongsToMany($permissionModel, $permissionRoleTable, $roleKey, $permissionKey)->withPivot('value', 'expires');
    }
public function permissions ( ) { $ permissionModel = config ( 'defender.permission_model' ) ; $ permissionRoleTable = config ( 'defender.permission_role_table' ) ; $ roleKey = config ( 'defender.role_key' ) ; $ permissionKey = config ( 'defender.permission_key' ) ; return $ this -> belongsToMany ( $ permissionModel , $ permissionRoleTable , $ roleKey , $ permissionKey ) -> withPivot ( 'value' , 'expires' ) ; }
Many-to-many permission-user relationship.

@return \Illuminate\Database\Eloquent\Relations\BelongsToMany
Many - to - many permission - user relationship .