]> BookStack Code Mirror - bookstack/blob - app/Permission.php
Added basic system tests for markdown editor, Added extra test helpers
[bookstack] / app / Permission.php
1 <?php
2
3 namespace BookStack;
4
5 use Illuminate\Database\Eloquent\Model;
6
7 class Permission extends Model
8 {
9     /**
10      * The roles that belong to the permission.
11      */
12     public function roles()
13     {
14         return $this->belongsToMany('BookStack\Permissions');
15     }
16
17     /**
18      * Get the permission object by name.
19      * @param $roleName
20      * @return mixed
21      */
22     public static function getByName($name)
23     {
24         return static::where('name', '=', $name)->first();
25     }
26 }