BookStack/app/Permission.php

24 lines
438 B
PHP
Raw Normal View History

<?php namespace BookStack;
2015-08-29 14:03:42 +00:00
class Permission extends Model
{
/**
* The roles that belong to the permission.
*/
public function roles()
{
return $this->belongsToMany('BookStack\Role');
2015-08-29 14:03:42 +00:00
}
/**
* Get the permission object by name.
* @param $name
* @return mixed
*/
public static function getByName($name)
{
return static::where('name', '=', $name)->first();
}
2015-08-29 14:03:42 +00:00
}