1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-01-31 20:21:36 +01:00
BookStack/app/Permission.php

27 lines
490 B
PHP
Raw Normal View History

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