CRUD
CRUD copied to clipboard
Fix column key definition
WHY
BEFORE - What was wrong? What was happening before this PR?
I already attempted it here: https://github.com/Laravel-Backpack/CRUD/pull/4504
It was not fully functional, this fixes it for good I hope.
AFTER - What is happening after this PR?
You can add columns with the same name and define them fluently.
HOW
How did you achieve that, in technical terms?
Can't use core crud functions because they rely on the column key already set, the only way to make it work with core crud function like modifyColumn etc was if we changed CrudColumn constructor to accept the key.
I manually add the column to the operation settings.
Is it a breaking change?
I don't think so.
How can we test the before & after?
In PetsCrudController, add:
CRUD::column('owners')->key('owners')->label('owner'); CRUD::column('owners')->key('owners_2')->label('owner 2'); CRUD::column('owners')->key('owners_3')->label('owner 3');
should yield:

Hi there @pxpm
I check on this, main branch, just show "owners" and "owners_3".

In "fix-column-key-definition" branch, show everything as as expected

I tried to play with orderable and works too.
For me look great, nothing to add this time.
Thanks for PR.
Cheers.
Hi @pxpm i can confirm now is working as expected. Hello @tabacitu, in my review look ready to merge.

Cheers.