PHP code example of distilleries / layout-manager
1. Go to this page and download the library: Download distilleries/layout-manager library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
distilleries / layout-manager example snippets php
'providers' => [
// ...
Distilleries\LayoutManager\LayoutManagerServiceProvider::class,
Distilleries\LayoutManager\LayoutManagerRouteServiceProvider::class
]
php
{
// ...
'menu' => \Distilleries\Expendable\Config\MenuConfig::menu([
'left' => [
[
'icon' => 'blackboard',
'action' => '\Distilleries\LayoutManager\Http\Controllers\Admin\TemplateController@getIndex',
'libelle' => 'menu.templates',
'submenu' => [
[
'icon' => 'th-list',
'libelle' => 'menu.list',
'action' => '\Distilleries\LayoutManager\Http\Controllers\Admin\TemplateController@getIndex',
],
[
'icon' => 'pencil',
'libelle' => 'menu.add',
'action' => '\Distilleries\LayoutManager\Http\Controllers\Admin\TemplateController@getEdit',
],
]
],
]
}
php
[
// ...
'template' => 'layout-manager::form.template',
'custom_fields' => [
// ...
'template' => 'Distilleries\LayoutManager\FormBuilder\Fields\Template',
],
]
ssh
php artisan vendor:publish --provider="Distilleries\LayoutManager\LayoutManagerServiceProvider"
ssh
php artisan vendor:publish --provider="Distilleries\FormBuilder\FormBuilderServiceProvider" --tag="views"
php
class ProjectForm extends Distilleries\FormBuilder\FormValidator
{
// ...
public function buildForm()
{
// ...
$this->add('templatable', 'form', [
'label' => trans('layout-manager::form.templatable'),
'icon' => 'link',
'class' => FormBuilder::create('Distilleries\LayoutManager\Forms\TemplatableForm', [
'model' => $this->model,
]),
]);
}
// ...
}
php
class ProjectForm extends Distilleries\FormBuilder\FormValidator
{
// ...
public function buildForm()
{
// ...
$this->add('templatable', 'form', [
'label' => trans('layout-manager::form.templatable'),
'icon' => 'link',
'class' => FormBuilder::create('Distilleries\LayoutManager\Forms\TemplatableForm', [
'model' => $this->model,
'categories' => [
'summary' => 'Summary of the project',
'authors' => 'Authors and credits',
]
]),
]);
}
// ...
}
php
class ProjectForm extends Distilleries\FormBuilder\FormValidator
{
// ...
public function buildForm()
{
// ...
$this->add('templatable', 'form', [
'label' => trans('layout-manager::form.templatable'),
'icon' => 'link',
'class' => FormBuilder::create('Distilleries\LayoutManager\Forms\TemplatableForm', [
'model' => $this->model,
'templates' => Template::whereIn('css_class', ['bo-banner-image', 'bo-underlined-header'])->get()
]),
]);
}
// ...
}
php
class ProjectForm extends Distilleries\FormBuilder\FormValidator
{
// ...
public function buildForm()
{
// ...
$this->add('templatable', 'form', [
'label' => trans('layout-manager::form.templatable'),
'icon' => 'link',
'class' => FormBuilder::create('Distilleries\LayoutManager\Forms\TemplatableForm', [
'model' => $this->model,
'custom-tags' => [
'video-player' => [
'youtube_id',
],
]
]),
]);
}
// ...
}
php
class ProjectForm extends Distilleries\FormBuilder\FormValidator
{
// ...
public function buildForm()
{
// ...
$this->add('templatable', 'form', [
'label' => trans('layout-manager::form.templatable'),
'icon' => 'link',
'class' => FormBuilder::create('Distilleries\LayoutManager\Forms\TemplatableForm', [
'model' => $this->model,
'disableAdd' => ['summary'],
'categories' => [
'summary' => 'Summary of the project',
'authors' => 'Authors and credits',
]
]),
]);
}
// ...
}