PHP code example of binomeway / nova-page-manager-tool

1. Go to this page and download the library: Download binomeway/nova-page-manager-tool 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/ */

    

binomeway / nova-page-manager-tool example snippets


public function tools(){
    return [
        \BinomeWay\NovaPageManagerTool\NovaPageManagerTool::make(),
    ];
}

namespace App\Templates;

use BinomeWay\NovaPageManagerTool\Template;

class AboutTemplate extends Template
{
    protected string $group = 'General'; // Displayed in the select field
    protected string $label = 'About Us'; // Displayed in the select field
    protected string $path = 'pages.about-us';
}


use  \BinomeWay\NovaPageManagerTool\Facades\TemplateManager;

public function boot() {
    TemplateManager::register([
   
       \App\Templates\AboutTemplate::class,
   
    ]);
}

namespace App\Blocks;

use BinomeWay\NovaPageManagerTool\Block;
use Laravel\Nova\Fields\Textarea;

class DescriptionSectionBlock extends Block
{
    /**
     * The layout's unique identifier
     *
     * @var string
     */
    protected $name = 'description-section';

    /**
     * The displayed title
     *
     * @var string
     */
    protected $title = 'Description Section';

    /**
     * The view path associated with this block.
     * @var string
     */
    protected string $component = 'blocks.description-section';

    /**
     * Get the fields displayed by the layout.
     *
     * @return array
     */
    public function fields()
    {
        return [
            Textarea::make(__('Description'), 'description')
        ];
    }
    
    public function customLogic(){
        // You can define custom methods and use them within view.
    }
}


// AppServiceProvider.php
use BinomeWay\NovaPageManagerTool\Facades\PageBuilder;

function boot() {
    
    PageBuilder::register([
        'description-section' => \App\Blocks\DescriptionSectionBlock::class,
    ]);
}
shell
php artisan vendor:publish --provider="\BinomeWay\NovaPageManagerTool\ToolServiceProvider" --tag="migrations"
shell
php artisan vendor:publish --provider="\BinomeWay\NovaPageManagerTool\ToolServiceProvider" --tag="config"
shell
php artisan vendor:publish --provider="\BinomeWay\NovaPageManagerTool\ToolServiceProvider" --tag="views"
shell
php artisan nova-page-manager:template AboutTemplate