]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Permissions/RolePermission.php
Skip intermediate login page with single provider
[bookstack] / app / Auth / Permissions / RolePermission.php
index 0a0e6ff17f531a3d16b3fab542716a84487dbc94..f34de917c07a425e7bf689c728d2edbe8ed2bfab 100644 (file)
@@ -4,6 +4,7 @@ namespace BookStack\Auth\Permissions;
 
 use BookStack\Auth\Role;
 use BookStack\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 
 /**
  * @property int $id
@@ -13,19 +14,15 @@ class RolePermission extends Model
     /**
      * The roles that belong to the permission.
      */
-    public function roles()
+    public function roles(): BelongsToMany
     {
         return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id');
     }
 
     /**
      * Get the permission object by name.
-     *
-     * @param $name
-     *
-     * @return mixed
      */
-    public static function getByName($name)
+    public static function getByName(string $name): ?RolePermission
     {
         return static::where('name', '=', $name)->first();
     }