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

Use widgets as a way to build details row #5655

Merged
merged 2 commits into from
Sep 6, 2024
Merged

Conversation

pxpm
Copy link
Contributor

@pxpm pxpm commented Sep 6, 2024

WHY

BEFORE - What was wrong? What was happening before this PR?

Suggested in Laravel-Backpack/community-forum#712

We could get creative with details row by allowing developers to add widgets there instead of just providing a way to overwrite the view.

At the moment, the only way to have a view, and pass additional control data was to:

  • create a view in your resources folder
  • overwrite the showDetailsRow($id) method.

In 10 controllers it gets cumbersome to have to overwrite the method in all of them to add some ['data' => 'my info'] to all of them.

AFTER - What is happening after this PR?

You can simply build a widget (a view for your details row), and pass any additional information on the widget directly instead of having to overwrite the method.

HOW

How did you achieve that, in technical terms?

Just added a @include() widgets view, and pull the widgets from the details_row section.

Is it a breaking change?

No.

@pxpm pxpm merged commit 9050d81 into main Sep 6, 2024
9 checks passed
@pxpm pxpm deleted the details-row-use-widgets branch September 6, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant