Layout snippets let you place your own components into the existing administration interface.

Creating a layout

A layout is made of two files — a PHP configuration file and the component template assigned to it. Both are created with an artisan command.
The command asks which kind of component you want, Vue or Blade.
With Vue, the component MyCustomLayout.vue is created in resources/views/admin/components/layouts. With Blade, the file MyCustomLayout.blade.php is created in resources/views/admin.

Configuring the layout

The first file is the PHP class holding the settings of the component.
app/Admin/Layouts/MyExampleLayout.php

Position

The $position property decides where the generated component is placed.

Supplying the component

A Vue component can also be created on its own, without the PHP configuration file, with php artisan admin:component MyTestLayout. Answer layout when asked for the component type.
Components are loaded recursively from resources/views/admin/components. The directory is configurable in the administration configuration.

Registering the layout

Assign the PHP configuration file to the admin model through the $layouts property.
app/Article.php
A Vue component needs no PHP configuration file — register it directly, where the array key is the position.
app/Article.php
In this case, create the standalone Vue component with php artisan admin:component MyTestLayout and answer layout when asked for the component type.

The Vue component

Through the props attribute the component receives the record being edited, the newly created record and other information you can work with.
resources/views/admin/components/layouts/MyCustomLayout.vue