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.

namespace App\Http\Controllers;

class DialogController extends Controller
    public function __construct(DialogResponse $response)
        $this->response = $response;

    public function showModal()
            ->setTitle('Dialog title')
            ->setBody('HTML body')
            ->setFooter('HTML footer')

        // or

            ->setDialog('HTML content')
                'backdrop' => 'static',

        return $this->response->send();