If you've seen issue 786 on laravel/nova-issues on Github or attempted to add custom buttons to Resources in Laravel Nova you are probably frustra...
For further actions, you may consider blocking this person and/or reporting abuse
Hi,
I want try this tool,but when install i am getting the following namespace parser error.
Fixed!
Just removed a vendor dir in project (rm -rf vendor)
Then run composer update
And try to create a new nova resourse-tool with following command:
php artisan nova:resource-tool my-vendor-name/custom-resource-toolbar
'my-vendor-name' should be in kebab case
It helped me, hope it will help you
After I run your command:
php artisan nova:resource-tool 0x15f/custom-resource-toolbar
The artisan in my project stopped working...
It always reports an error with this wierd thing
In case if you know how to fix it please let me know!
what do you mean with
add it to your Resources
?This is the important part: "You can define your resources toolbar component by registering a component with your resources plural name followed by -detail-toolbar."
So in my case, I was using for an Article nova resource. So I changed the 'quotes-detail-toolbar' to 'articles-detail-toolbar'. That's it. You don't even need to add it as a tool, like you do with most other Nova tools in your NovaServiceProvider.
The button will now show up in your Resource (url should be something like: '/resources/articles/76'), assuming you ran 'npm run dev' on your tool.
hi ! i'm so sorry, i'm learning laravel and i dont understand where i can add my button. I mean i did all of things at top, but event a random button doesnt appeared x3
Yes! When you add the resource tool to the model use the canSee method you use to hide fields and stuff. More info here
Hello,
great job !
I do this in the Index page - and it works perfectly!
I have one question, maybe you have any idea how to add to button permissions?
On the detail page I can use withMeta method, but is there any way to pass the permission to do the action on index page ?
Thank you for this tutorial but can you please explain how to use this on a resource? Thank you!
This is the important part: "You can define your resources toolbar component by registering a component with your resources plural name followed by -detail-toolbar."
So in my case, I was using for an Article nova resource. So I changed the 'quotes-detail-toolbar' to 'articles-detail-toolbar'. That's it. You don't even need to add it as a tool, like you do with most other Nova tools in your NovaServiceProvider.
The button will now show up in your Resource (url should be something like: '/resources/articles/76'), assuming you ran 'npm run dev' on your tool.
This is really simple! thank you very much.