Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Fix: Ensure generated policies return boolean values #53630

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Illuminate/Foundation/Console/stubs/policy.stub
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,54 @@ class {{ class }}
*/
public function viewAny({{ user }} $user): bool
{
//
return true;
}

/**
* Determine whether the user can view the model.
*/
public function view({{ user }} $user, {{ model }} ${{ modelVariable }}): bool
{
//
return true;
}

/**
* Determine whether the user can create models.
*/
public function create({{ user }} $user): bool
{
//
return true;
}

/**
* Determine whether the user can update the model.
*/
public function update({{ user }} $user, {{ model }} ${{ modelVariable }}): bool
{
//
return true;
}

/**
* Determine whether the user can delete the model.
*/
public function delete({{ user }} $user, {{ model }} ${{ modelVariable }}): bool
{
//
return true;
}

/**
* Determine whether the user can restore the model.
*/
public function restore({{ user }} $user, {{ model }} ${{ modelVariable }}): bool
{
//
return true;
}

/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete({{ user }} $user, {{ model }} ${{ modelVariable }}): bool
{
//
return true;
}
}