belongsToMany('BookStack\Permissions'); } /** * Get the permission object by name. * @param $roleName * @return mixed */ public static function getByName($name) { return static::where('name', '=', $name)->first(); } }