GitHub

Dialogs

This example illustrates dynamic opening of a dialog but also working with multiple dialogs at once.
  • setController

    Sets the JavaScript class controller - if you need to register an extra event listeners (show, shown, hide, hidden) or logic.

  • setTitle

    Sets the title of a dialog.

  • setBody

    Sets the body of a dialog.

  • setFooter

    Sets the footer of a dialog.

  • setDialog

    Sets the whole content of a dialog.

  • closeDialogs

    Close all opened dialogs.

  • closeDialog

    Close only current dialog.

  • dialog

    Render defined dialog.

Controller.php
namespace App\Http\Controllers;

use App\Arch\BigPipe\DialogResponse;

class DialogController extends Controller
{
    public function showModal()
    {
        return (new DialogResponse())
            ->setTitle('Dialog title')
            ->setBody('HTML body')
            ->setFooter('HTML footer')
            ->setBackdrop('static')
            ->dialog()
            ->send();

        // or the whole content of the dialog

        return (new DialogResponse())
            ->setDialog('HTML content')
            ->dialog()
            ->send();
    }
}
Try it