PHP code example of dewsign / nova-pages

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

    

dewsign / nova-pages example snippets


public function tools()
{
    return [
        ...
        new \Dewsign\NovaPages\Nova\NovaPagesTool,
        ...
    ];
}

'repeaters' => [
    'More\Repeaters'
],

'replaceRepeaters' => true,

'homepageSlug' => 'homepage',

'models' => [
    'page' => 'App\Page',
],
'resources' => [
    'page' => 'App\Nova\Page',
],

'group' => 'Pages',

// database/seeds/DatabaseSeeder.php

public function run()
{
    $this->call(Dewsign\NovaPages\Database\Seeds\PageSeeder::class);
}

return [
    ...
    'domainMap' => [
        'careers',
    ],
];

route('pages.show', ['path' => 'careers']);
// https://mydomain.com/careers

route('domain.pages.show', ['domain' => 'careers', 'path' => 'vacancies']);
// https://careers.mydomain.com/vacancies

// config/app.php

'providers' => [
    ...
    Dewsign\NovaPages\Providers\AuthServiceProvider::class,
],

$page = Page::meta('page-slug', 'Default Text');

[
    'page_title' => 'Default Text',
    'browser_title' => 'Default Text',
    'meta_description' => 'Default Text',
    'h1' => 'Default Text',
];

<html lang="{{ array_get($page ?? [], 'language', app()->getLocale()) }}">
sh
php artisan migrate