@@ -2,16 +2,16 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Permission\Models; |
4 | 4 | |
5 | -use Spatie\Permission\Guard; |
|
6 | 5 | use Illuminate\Database\Eloquent\Model; |
7 | -use Spatie\Permission\Traits\HasPermissions; |
|
8 | -use Spatie\Permission\Exceptions\RoleDoesNotExist; |
|
6 | +use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
|
7 | +use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
8 | +use Spatie\Permission\Contracts\Role as RoleContract; |
|
9 | 9 | use Spatie\Permission\Exceptions\GuardDoesNotMatch; |
10 | 10 | use Spatie\Permission\Exceptions\RoleAlreadyExists; |
11 | -use Spatie\Permission\Contracts\Role as RoleContract; |
|
11 | +use Spatie\Permission\Exceptions\RoleDoesNotExist; |
|
12 | +use Spatie\Permission\Guard; |
|
13 | +use Spatie\Permission\Traits\HasPermissions; |
|
12 | 14 | use Spatie\Permission\Traits\RefreshesPermissionCache; |
13 | -use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
14 | -use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
|
15 | 15 | |
16 | 16 | class Role extends Model implements RoleContract |
17 | 17 | { |
@@ -2,17 +2,17 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Permission\Models; |
4 | 4 | |
5 | -use Spatie\Permission\Guard; |
|
6 | -use Illuminate\Support\Collection; |
|
7 | -use Spatie\Permission\Traits\HasRoles; |
|
8 | 5 | use Illuminate\Database\Eloquent\Model; |
9 | -use Spatie\Permission\PermissionRegistrar; |
|
10 | -use Spatie\Permission\Traits\RefreshesPermissionCache; |
|
11 | -use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
12 | -use Spatie\Permission\Exceptions\PermissionDoesNotExist; |
|
13 | 6 | use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
14 | -use Spatie\Permission\Exceptions\PermissionAlreadyExists; |
|
7 | +use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
8 | +use Illuminate\Support\Collection; |
|
15 | 9 | use Spatie\Permission\Contracts\Permission as PermissionContract; |
10 | +use Spatie\Permission\Exceptions\PermissionAlreadyExists; |
|
11 | +use Spatie\Permission\Exceptions\PermissionDoesNotExist; |
|
12 | +use Spatie\Permission\Guard; |
|
13 | +use Spatie\Permission\PermissionRegistrar; |
|
14 | +use Spatie\Permission\Traits\HasRoles; |
|
15 | +use Spatie\Permission\Traits\RefreshesPermissionCache; |
|
16 | 16 | |
17 | 17 | class Permission extends Model implements PermissionContract |
18 | 18 | { |
@@ -2,11 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Permission\Traits; |
4 | 4 | |
5 | +use Illuminate\Database\Eloquent\Builder; |
|
6 | +use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
5 | 7 | use Illuminate\Support\Collection; |
6 | 8 | use Spatie\Permission\Contracts\Role; |
7 | -use Illuminate\Database\Eloquent\Builder; |
|
8 | 9 | use Spatie\Permission\PermissionRegistrar; |
9 | -use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
10 | 10 | |
11 | 11 | trait HasRoles |
12 | 12 | { |
@@ -52,7 +52,6 @@ |
||
52 | 52 | * Scope the model query to certain roles only. |
53 | 53 | * |
54 | 54 | * @param \Illuminate\Database\Eloquent\Builder $query |
55 | - * @param string|array|\Spatie\Permission\Contracts\Role|\Illuminate\Support\Collection $roles |
|
56 | 55 | * @param string $guard |
57 | 56 | * |
58 | 57 | * @return \Illuminate\Database\Eloquent\Builder |
@@ -2,14 +2,14 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Permission\Traits; |
4 | 4 | |
5 | -use Spatie\Permission\Guard; |
|
6 | -use Illuminate\Support\Collection; |
|
7 | 5 | use Illuminate\Database\Eloquent\Builder; |
8 | -use Spatie\Permission\PermissionRegistrar; |
|
6 | +use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
7 | +use Illuminate\Support\Collection; |
|
9 | 8 | use Spatie\Permission\Contracts\Permission; |
10 | 9 | use Spatie\Permission\Exceptions\GuardDoesNotMatch; |
11 | -use Illuminate\Database\Eloquent\Relations\MorphToMany; |
|
12 | 10 | use Spatie\Permission\Exceptions\PermissionDoesNotExist; |
11 | +use Spatie\Permission\Guard; |
|
12 | +use Spatie\Permission\PermissionRegistrar; |
|
13 | 13 | |
14 | 14 | trait HasPermissions |
15 | 15 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * @param string|array|\Spatie\Permission\Contracts\Permission|\Illuminate\Support\Collection $permissions |
|
89 | + * @param string|array|\Spatie\Permission\Contracts\Permission|\Illuminate\Support\Collection $listOfPermissions |
|
90 | 90 | * |
91 | 91 | * @return array |
92 | 92 | */ |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | /** |
247 | 247 | * Determine if the model has the given permission. |
248 | 248 | * |
249 | - * @param string|int|\Spatie\Permission\Contracts\Permission $permission |
|
249 | + * @param Permission $permission |
|
250 | 250 | * |
251 | 251 | * @return bool |
252 | 252 | * @throws PermissionDoesNotExist |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Permission; |
4 | 4 | |
5 | +use Illuminate\Filesystem\Filesystem; |
|
5 | 6 | use Illuminate\Routing\Route; |
6 | 7 | use Illuminate\Support\Collection; |
7 | -use Illuminate\Filesystem\Filesystem; |
|
8 | 8 | use Illuminate\Support\ServiceProvider; |
9 | 9 | use Illuminate\View\Compilers\BladeCompiler; |
10 | -use Spatie\Permission\Contracts\Role as RoleContract; |
|
11 | 10 | use Spatie\Permission\Contracts\Permission as PermissionContract; |
11 | +use Spatie\Permission\Contracts\Role as RoleContract; |
|
12 | 12 | |
13 | 13 | class PermissionServiceProvider extends ServiceProvider |
14 | 14 | { |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use Illuminate\Support\Collection; |
7 | -use Spatie\Permission\Models\Role; |
|
8 | 7 | use Spatie\Permission\Models\Permission; |
8 | +use Spatie\Permission\Models\Role; |
|
9 | 9 | |
10 | 10 | class Show extends Command |
11 | 11 | { |
@@ -3,11 +3,11 @@ |
||
3 | 3 | namespace Spatie\Permission; |
4 | 4 | |
5 | 5 | use Illuminate\Cache\CacheManager; |
6 | -use Illuminate\Support\Collection; |
|
7 | -use Spatie\Permission\Contracts\Role; |
|
6 | +use Illuminate\Contracts\Auth\Access\Authorizable; |
|
8 | 7 | use Illuminate\Contracts\Auth\Access\Gate; |
8 | +use Illuminate\Support\Collection; |
|
9 | 9 | use Spatie\Permission\Contracts\Permission; |
10 | -use Illuminate\Contracts\Auth\Access\Authorizable; |
|
10 | +use Spatie\Permission\Contracts\Role; |
|
11 | 11 | |
12 | 12 | class PermissionRegistrar |
13 | 13 | { |