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

[Feature] withLinks() helper for columns #24

Closed
tabacitu opened this issue Mar 31, 2020 · 4 comments
Closed

[Feature] withLinks() helper for columns #24

tabacitu opened this issue Mar 31, 2020 · 4 comments

Comments

@tabacitu
Copy link
Member

After the Fluent syntax is finished and merged for Columns, we should probably create a helper for automatically adding column links. Instead of having to define the path yourself, we should be able to determine that, if there's a CrudController for that entity.

// we should be able to do
CRUD::column('categories')->type('relationship')->withLinks();

// instead of
CRUD::column('categories')->type('relationship')->wrapper([
    'href' => function ($crud, $column, $entry, $related_key) {
        return backpack_url('category/'.$related_key.'/show');
    },
]);
@tabacitu
Copy link
Member Author

tabacitu commented Mar 31, 2020

This is one of the benefits of having the fluent syntax - that you can do stuff like that. Do you appreciate it now @pxpm ? See, there's finally the potential for something useful out of all the weeks of work on this! 😆

@pxpm
Copy link

pxpm commented Apr 4, 2020

This just seems beautifull. Want me to have a look at the withLinks ?

@tabacitu
Copy link
Member Author

tabacitu commented Apr 4, 2020

HA! I knew I'd turn you around 😄

Yes please, not right now, better next week. I'm still polishing the fluent syntax. It's 95% complete, but I might just rewrite the whole thing so it's exactly the same for Fields, Columns, Filters, Buttons, Widgets. Right now the syntax is the same, but the implementations are pretty different - I played around to see which one works best.

If you want to play around with this, branch out from the fluent-syntax branch, and take a look at this example for a convenience method for fields.

@tabacitu tabacitu transferred this issue from Laravel-Backpack/CRUD Jul 25, 2020
@tabacitu tabacitu changed the title [4.1.0][Feature] withLinks() helper for columns [Feature] withLinks() helper for columns Dec 21, 2022
@tabacitu
Copy link
Member Author

tabacitu commented Nov 8, 2023

Done in Laravel-Backpack/CRUD#5317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants