make it so fields can be added to the end? #1019
Replies: 1 comment
-
@prescriptionlifeline indeed, I never, ever use it and never recommend anyone to use it. For now I really advise you to use option 2. If you have multiple CRUDS that has similar/same fields you can always create a Trait with those field definitions and add it to your controllers. I am going to close this, but if you feel I am wrong, please re-open, or comment back and we can re-open it, and evaluate the situation. Cheers 🙏 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Per https://backpackforlaravel.com/docs/6.x/crud-api#create-update-operations you can add a field after another one or before another one but you can't add one at the end.
If you want to add a field at the beginning then you can just use
->first()
for that column in that migration and then callCRUD::setFromDb()
but if you want to add a field at the end your option are:setup*Operation()
instead of usingCRUD::setFromDb()
Between those two options I guess the second is preferable but I'd prefer something like
$this->crud->addField()->placementFromEnd(0)
or some such instead.Beta Was this translation helpful? Give feedback.
All reactions