Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yaeykay's avatar

Laravel Nova Disabling Create Button

When I want to disable create button in nova resource, I know two options:

  • Using Laravel Policy
  • authorizedToCreate method within the resource.

But using policy in nova resource, you don't have access to whatever resource you're dealing with, only the Authenticated User.

public function create(User $user)
{
    return $user->isAdmin();
}

The same goes to authorizedToCreate method within the resource, only the Request passed to the method.

Having Post model and Comment model that belongs to post, how can I disable the create button in laravel nova depending on the Post status?

0 likes
0 replies

Please or to participate in this conversation.