daaner /
laravel-template
| 1 | <?php |
||||||||
| 2 | |||||||||
| 3 | namespace App\Admin\Policies; |
||||||||
| 4 | |||||||||
| 5 | use App\Admin\Sections\Settings as Section; |
||||||||
| 6 | use App\Setting as Model; |
||||||||
| 7 | use App\User; |
||||||||
| 8 | use Illuminate\Auth\Access\HandlesAuthorization; |
||||||||
| 9 | |||||||||
| 10 | class SettingsSectionModelPolicy |
||||||||
| 11 | { |
||||||||
| 12 | use HandlesAuthorization; |
||||||||
| 13 | |||||||||
| 14 | /** |
||||||||
| 15 | * @param User $user |
||||||||
| 16 | * @param string $ability |
||||||||
| 17 | * @param Settings $section |
||||||||
| 18 | * @param Setting $item |
||||||||
| 19 | * |
||||||||
| 20 | * @return bool |
||||||||
| 21 | */ |
||||||||
| 22 | public function before(User $user, $ability, Section $section, Model $item = null) |
||||||||
|
0 ignored issues
–
show
The parameter
$ability is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
The parameter
$user is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
The parameter
$item is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||||||
| 23 | { |
||||||||
| 24 | // if ($user->isAdmin()) { |
||||||||
| 25 | // return true; |
||||||||
| 26 | // } |
||||||||
| 27 | } |
||||||||
| 28 | |||||||||
| 29 | public function display(User $user, Section $section, Model $item) |
||||||||
|
0 ignored issues
–
show
The parameter
$item is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
The parameter
$section is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||||||
| 30 | { |
||||||||
| 31 | if ($user->isAdmin()) { |
||||||||
| 32 | return true; |
||||||||
| 33 | } |
||||||||
| 34 | |||||||||
| 35 | return true; |
||||||||
| 36 | } |
||||||||
| 37 | |||||||||
| 38 | public function edit(User $user, Section $section, Model $item) |
||||||||
|
0 ignored issues
–
show
The parameter
$item is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
The parameter
$section is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||||||
| 39 | { |
||||||||
| 40 | if ($user->isAdmin()) { |
||||||||
| 41 | return true; |
||||||||
| 42 | } |
||||||||
| 43 | |||||||||
| 44 | return false; |
||||||||
| 45 | } |
||||||||
| 46 | } |
||||||||
| 47 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.