]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Permissions/RolePermission.php
Skip intermediate login page with single provider
[bookstack] / app / Auth / Permissions / RolePermission.php
index 8b07b3073bf9add0eb1f4a216844c69e05235832..f34de917c07a425e7bf689c728d2edbe8ed2bfab 100644 (file)
@@ -1,24 +1,28 @@
-<?php namespace BookStack\Auth\Permissions;
+<?php
+
+namespace BookStack\Auth\Permissions;
 
 use BookStack\Auth\Role;
 use BookStack\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 
+/**
+ * @property int $id
+ */
 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();
     }