src/Traits/RoleHasRelations.php
public function attachPermission($permission)
    {
        return (!$this->permissions()->get()->contains($permission)) ? $this->permissions()->attach($permission) : true;
    }
public function attachPermission($permission)
    {
        return (!$this->permissions()->get()->contains($permission)) ? $this->permissions()->attach($permission) : true;
    }
public function attachPermission ( $ permission ) { return ( ! $ this -> permissions ( ) -> get ( ) -> contains ( $ permission ) ) ? $ this -> permissions ( ) -> attach ( $ permission ) : true ; }
Attach permission to a role.

@param int|Permission $permission

@return int|bool
Attach permission to a role .