src/Defender/Traits/Permissions/InteractsWithPermissions.php
public function attachPermission($permission, array $options = [])
    {
        if (! is_array($permission)) {
            if ($this->existPermission($permission->name)) {
                return;
            }
        }

        $this->permissions()->attach($permission, [
            'value'   => array_get($options, 'value', true),
            'expires' => array_get($options, 'expires', null),
        ]);
    }
public function attachPermission($permission, array $options = [])
    {
        if (! is_array($permission)) {
            if ($this->existPermission($permission->name)) {
                return;
            }
        }

        $this->permissions()->attach($permission, [
            'value'   => array_get($options, 'value', true),
            'expires' => array_get($options, 'expires', null),
        ]);
    }
public function attachPermission ( $ permission , array $ options = [ ] ) { if ( ! is_array ( $ permission ) ) { if ( $ this -> existPermission ( $ permission -> name ) ) { return ; } } $ this -> permissions ( ) -> attach ( $ permission , [ 'value' => array_get ( $ options , 'value' , true ) , 'expires' => array_get ( $ options , 'expires' , null ) , ] ) ; }
Attach the given permission.

@param array|\Artesaos\Defender\Permission $permission
@param array                               $options
Attach the given permission .