<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tokarskimarcin / laravel-admin-ext-modal-form example snippets
use Encore\Admin\Layout\Content;
use Encore\Admin\Layout\Column;
use Encore\Admin\Layout\Row;
use Encore\Admin\Widgets\Box;
use Encore\ModalForm\Form\ModalButton;
class HomeController {
...
public function index(Content $content)
{
return $content->row(function (Row $row){
$row->column(4, function (Column $column){
$box = new Box();
//creates modal button with `Modal` title and generated route
$modalButton = new ModalButton('Modal', route('modal-form.create'));
$box->content($modalButton);
$column->append($box);
});
});
}
}
//overrides classes of html button tag
$modalButton->setClass('btn-primary');
//appends class to existing once
$modalButton->addClass('btn-primary');
//retrieving settled classes as string
$modalButton->getClasses();
//sets href
$modalButton->setHref('url');
//returns settled hrefg
$modalButton->getHref();
use \Encore\ModalForm\Form\ModalForm;
new ModalForm(new Administrator(), function (ModalForm $form){
$form->display('id', 'ID');
//set action for proper submitting
$form->setAction(route('modal-index-route'));
});
use \Encore\ModalForm\Facades\Modal;
Modal::form(new Administrator(), function (ModalForm $form){
...
});
$form->small();
$form->medium();
$form->large();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.