Skip to content

Commit f21b5a0

Browse files
authored
Update README.md
1 parent 8c3bb23 commit f21b5a0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,21 @@ With this package your are also able to add a create button for the foreign CRUD
164164

165165
### Modal view
166166

167-
By default the modal is loaded automatically by using `entity` in `on_the_fly` of the field definition resulting in `backpack_url($field['on_the_fly']['entity']).'/ajax/create'` in the field blade.
167+
By default the modals are loaded automatically by using `entity` in `on_the_fly` of the field definition, e.g. resulting in `backpack_url($field['on_the_fly']['entity']).'/ajax/create'` for the create modal.
168168

169-
You can overwrite this behavior by setting a `create_view` attribute:
169+
You can overwrite this behavior for all modals by setting an attribute:
170170

171171
```
172172
'on_the_fly' => [
173173
'entity' => 'entity',
174-
'create_view => 'route/to/modal/html'
174+
'create_modal' => 'route/to/modal/html',
175+
'edit_modal' => 'route/to/modal/html',
176+
'delete_modal' => 'route/to/modal/html',
175177
]
176178
```
177179

180+
> Please be aware that by using this attributes you will be completely responsible for the content of the modal! The defined request has to provide valid HTML which is then filled in `<div class="modal-content"></div>`
181+
178182
### Search logic
179183

180184
The "instant field" triggers the `ajaxIndex()` of the `EntityCrudController` where the field is defined and uses the fields `model` and `attribute` parameters to perform the search on the foreign model.

0 commit comments

Comments
 (0)