PHP code example of lukesnowden / laraview

1. Go to this page and download the library: Download lukesnowden/laraview 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/ */

    

lukesnowden / laraview example snippets


'providers' => [
    // ...
    Laraview\Providers\AppServiceProvider::class
];



namespace App\Providers;

use App\Laraview\CustomerEdit\CustomerEditView;
use Illuminate\Support\ServiceProvider;
use Laraview\Libs\Blueprints\RegisterBlueprint;

class ViewServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        $this->app->booted( function( $app ) {
            $app[ RegisterBlueprint::class ]->attachView( new CustomerEditView );
        });
    }

}



namespace App\Laraview\CustomerEdit;

use App\Laraview\CustomerEdit\Regions\LeftColumnRegion;
use App\Laraview\CustomerEdit\Regions\RightColumnRegion;
use Laraview\Libs\Blueprints\ViewBlueprint;
use Laraview\Libs\BaseView;

class CustomerEditView extends BaseView implements ViewBlueprint
{

    /**
     * @var string
     */
    protected $path = 'customers.edit';

    /**
     * @var string
     */
    protected $baseViewPath = 'template.blade.php';

    /**
     * Regions to attach to this view
     * @var array
     */
    protected $regions = [
        LeftColumnRegion::class,
        RightColumnRegion::class
    ];

}



namespace App\Laraview\CustomerEdit\Regions;

use App\Laraview\CustomerEdit\Regions\LeftColum\Elements\ForenameTextElement;
use App\Laraview\CustomerEdit\Regions\LeftColum\Elements\SurnameTextElement;
use Laraview\Libs\Blueprints\RegionBlueprint;
use Laraview\Libs\BaseRegion;

class LeftColumnRegion extends BaseRegion implements RegionBlueprint
{

    /**
     * @var string
     */
    protected $placeholder = '[LEFT_COLUMN]';

    /**
     * @var array
     */
    protected $elements = [
        ForenameTextElement::class,
        SurnameTextElement::class
    ];

}
cli
php artisan laraview:compile
cli
php artisan laraview:view
cli
php artisan make:provider ViewServiceProvider
cli
php artisan laraview:region
cli
php artisan laraview:element