You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am I correct to say that $this->setAjaxEntity('soft-drink'); is added to setup() method of SoftDrinkCrudController only?
I'm going to add this field definition to DrinkingUserCrudController but it doesn't seem to work (after all users table has no soft_drink_id. Is UserCrudController the right place? Or is this supposed to be added to SoftDrinkCrudController to allow create/edit user to show the field to add soft drinks?
For instant create button in list view, May I assume it is this?
Inside DrinkingUserCrudController
$this->addInstantCreateButtonToList(
'soft-drink', // foreign entity. Should it be soft-drink or softDrinks?
'add soft drink', // content of the button
'soft-drink-id', // the name of the ID of the current entity will be
);
Thank you!
The text was updated successfully, but these errors were encountered:
I know this is a bit confusing, but there are some technical limitations in Laravel Backpack so I had to trick a bit. That's the reason why I recommend using the trait and routes for all (involved) CrudControllers.
yes
yes
yes - should be enough in your case but:
this won't work for you currently*
yes, should be right
*The kind of field type you need is not available yet:
You need a corresponding field type to the function of the button (5.) in the crud list. I definitively see the requirement for such a field type and hope we can provide it soon, because we also need it.
Detailed description
Hi! wanted to ask some questions as I am confused over the documentation given the use of a generic word like 'entity'
Imagine I have 2 models. SoftDrink and User with the following rules:
My questions are below:
Do I have to add InstantFields trait to both SoftDrinkCrudController and DrinkingUserCrudController?
Do I have to do this to both DrinkingUser and SoftDrink backpack routes?
Am I correct to say that
$this->setAjaxEntity('soft-drink');
is added to setup() method of SoftDrinkCrudController only?I'm going to add this field definition to DrinkingUserCrudController but it doesn't seem to work (after all users table has no soft_drink_id. Is UserCrudController the right place? Or is this supposed to be added to SoftDrinkCrudController to allow create/edit user to show the field to add soft drinks?
Thank you!
The text was updated successfully, but these errors were encountered: