laravellaravel-backpacklaravel-backpack-5

how can i load a custom view for the inline-create in backpack?


I'm using InlineCreate for many Controllers with different fields and custom js code loaded using Widget::add()

the problem is that the js code is not loading in the modal and I've thought about loading the js code inside the inline_create_modal.blade.php witch can be easily overridden.

The problem is that I can't figure out how to load a different inline_create_modal.blade.php file for each Controller. I thought it was easy like loading a different view or create.blade file but I can't make it work.

Could someone give me an ideea?

Tks.


Solution

  • You should be able to pass your scripts inline if you also add inline() in your widget definition.

    I've done a really bad job here as I didn't add this to the docs anywhere.

    I've just added the following section to the docs: https://backpackforlaravel.com/docs/6.x/crud-operation-inline-create#using-widgets-with-inline-create

    Here is an example I gave to other user: https://github.com/Laravel-Backpack/CRUD/issues/4840#issuecomment-1361248539

    Hope it helps.

    If you find any bug, feel free to open a new issue in the Github repository.

    Cheers