• This project
    • Loading...
  • Sign in

Зуев Егор / wiki.dev

Logo belkanton
Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • wiki.dev
  • app
  • Permission.php
  • Dan Brown's avatar
    Improved permission regen performance by factor of 4 · 59367b34 ...
    59367b34
    Worked around slower eloquent access to speed up permission generation.
    Dan Brown authored 2016-04-30 17:16:06 +0100
Permission.php 438 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php namespace BookStack;


class Permission extends Model
{
    /**
     * The roles that belong to the permission.
     */
    public function roles()
    {
        return $this->belongsToMany('BookStack\Role');
    }

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