1. Go to this page and download the library: Download aichadigital/lara-content 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/ */
use AichaDigital\LaraContent\Registries\LayoutRegistry;
use App\Content\Layouts\CustomLayout;
public function boot(): void
{
app(LayoutRegistry::class)->register(new CustomLayout());
}
use AichaDigital\LaraContent\Registries\BlockRegistry;
use App\Content\Blocks\CustomBlock;
public function boot(): void
{
app(BlockRegistry::class)->register(new CustomBlock());
}
use AichaDigital\LaraContent\Models\Page;
// Crear una página
$page = Page::create([
'title' => 'Sobre Nosotros',
'slug' => 'sobre-nosotros',
'layout' => 'sidebar-right',
'status' => 'published',
]);
// Añadir bloques a zonas
$page->blocks()->create([
'zone' => 'main',
'block_type' => 'html',
'content' => ['html' => '<p>Bienvenido a nuestra empresa...</p>'],
'order' => 1,
]);
use AichaDigital\LaraContent\Registries\LayoutRegistry;
use App\Content\Layouts\MiLayout;
public function boot(): void
{
app(LayoutRegistry::class)->register(new MiLayout());
}
use AichaDigital\LaraContent\Registries\BlockRegistry;
use App\Content\Blocks\MiBloque;
public function boot(): void
{
app(BlockRegistry::class)->register(new MiBloque());
}