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

[Bug] addButtonFromView($stack, $name, $view, $position = false) without 'meta' #5741

Closed
zivarg opened this issue Dec 28, 2024 · 2 comments
Closed
Labels

Comments

@zivarg
Copy link

zivarg commented Dec 28, 2024

Bug report

Why method addButtonFromView without meta?

Copy link

Based on the knowledge sources provided, I can address your question about the addButtonFromView method in Backpack.

The addButtonFromView method in Backpack does not explicitly include a 'meta' parameter in its signature. However, this doesn't mean you can't use meta data with custom buttons.

According to the Backpack documentation on creating custom buttons, you can use meta data in your custom button views. The documentation states:

"In the blade file, you can use:

  • $meta['something'] - any custom attribute the developer has passed, using the metas() method;"

This suggests that while the addButtonFromView method doesn't directly take a 'meta' parameter, you can still pass meta data to your custom buttons using the metas() method.

The correct syntax for adding a button from a view is:

CRUD::addButtonFromView($stack, $name, $view, $position);

If you need to add meta data to your button, you would likely do this separately using the metas() method, although the exact implementation isn't specified in the provided knowledge sources.

It's worth noting that the Backpack API has evolved over time, and some methods may have been updated or changed. If you're experiencing issues with this method or need more specific information about using meta data with buttons, you might want to consult the most recent Backpack documentation or reach out to the Backpack community for support.

ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️

Relevant sources:

Github Issue (closed): addButtonFromView position ignored
Fix adding button from view
Github Issue (closed): addButtonFromView not working
Github Issue (closed): [Bug] Quick button implementation
Github Issue (closed): laravel backpack and iis and sql server
CRUD API|Buttons
Buttons|Buttons API
CRUD API Cheat Sheet|Buttons
Github Issue (closed): [Bug] Adding a button to 'end' of 'line' doesn't position it after edit button
Cannot add button in updateOperation
Github Issue (closed): [3.4][Feature] Allow setting a custom view for fields/columns/filters/buttons
Github Issue (closed): Document Request: Document how to use addButtonFromView
Github Issue (closed): Custom buttons
Github Issue (closed): [Feature proposal] Fluent syntax for CRUD

@jcastroa87
Copy link
Member

Hello @zivarg

As Kapa says, if you check our docs you can use meta for that's method.

I will close this issue, but please feel free to re-open or create a new one if needed.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants