Skip to content

Commit

Permalink
Merge branch '10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Jul 20, 2024
2 parents febb2d9 + 560bb8c commit b798097
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 121 deletions.
11 changes: 6 additions & 5 deletions app/Nova/Policies/ProfilePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use App\Models\User;
use App\Nova\Profile;
use Illuminate\Auth\Access\Response;

class ProfilePolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
public function viewAny(User $user): Response
{
return ! $user->isBlockedFrom('profile.viewAny')
? Response::allow()
Expand All @@ -20,7 +21,7 @@ public function viewAny(User $user): bool
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Profile $profile): bool
public function view(User $user, Profile $profile): Response
{
return ! $user->isBlockedFrom('profile.view.'.$profile->id)
? Response::allow()
Expand All @@ -30,7 +31,7 @@ public function view(User $user, Profile $profile): bool
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(User $user): Response
{
return ! $user->isBlockedFrom('profile.create')
? Response::allow()
Expand All @@ -40,7 +41,7 @@ public function create(User $user): bool
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Profile $profile): bool
public function update(User $user, Profile $profile): Response
{
return ! $user->isBlockedFrom('profile.update.'.$profile->id)
? Response::allow()
Expand All @@ -64,6 +65,6 @@ public function delete(User $user, Profile $profile): bool
*/
public function addPassport(User $user, Profile $profile)
{
return Str::endsWith($user->email, '@laravel.com');
return str_ends_with($user->email, '@laravel.com');
}
}
116 changes: 0 additions & 116 deletions app/Policies/ProfilePolicy.php

This file was deleted.

0 comments on commit b798097

Please sign in to comment.