Skip to content
Discussion options

You must be logged in to vote

Shouldn't you just do the following:

    /**
     * Get the actions available for the resource.
     *
     * @param \Laravel\Nova\Http\Requests\NovaRequest $request
     * @return array
     */
    public function actions(NovaRequest $request)
    {
        return [
           (new Actions\Approve)
               ->confirmText('Are you sure you want to approve this leave?')
               ->confirmButtonText('Approve')
               ->cancelButtonText("Don't approve")
               ->showInline()
                ->canSee(function ($request) {
                    return true;
               })
               ->canRun(function ($request, $model) {
                  return $model->leaveType

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shimaxu
Comment options

Answer selected by shimaxu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4871 on October 03, 2022 22:44.