PHP code example of den1n / nova-blog

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

    

den1n / nova-blog example snippets


/**
 * Get the tools that should be listed in the Nova sidebar.
 *
 * @return array
 */
public function tools()
{
    return [
        new \Den1n\NovaBlog\Tool,
    ];
}

Route::novaBlogRoutes();

Route::novaBlogRoutes('/blog');

use \Den1n\NovaPosts\Models\Post;

$url = route('nova-blog.post', [
    'post' => Post::find(1),
]);

// Or you can pass a post slug.
$url = route('nova-blog.post', [
    'post' => 'my-post-slug',
]);

/**
 * Array of templates used by controller.
 */

'templates' => [
    // ...
    [
        'name' => 'rich',
        'description' => 'A rich template',
    ],
],

    /**
     * Settings for WYSIWYG editor.
     */

    'editor' => [
        /**
         * Nova field class name.
         */

        'class' => \Froala\NovaFroalaField\Froala::class,

        /**
         * Options which will be applied to te field instance.
         * Key: name of field method.
         * Value: list of method arguments.
         */

        'options' => [
            'withFiles' => ['public', 'nova-pages'],

            // Froala options.
            'options' => [[
                'heightMax' => 800,
                'heightMin' => 300,
            ]],
        ],
    ],
sh
php artisan vendor:publish --provider="Den1n\NovaBlog\ServiceProvider"
sh
php artisan migrate