PHP code example of pavloniym / nova-iframe-page

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

    

pavloniym / nova-iframe-page example snippets


use Pavloniym\NovaIframePage\NovaIframePage;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    // ...

    /**
     * Register the Nova routes.
     *
     * @return void
     */
    protected function routes()
    {
        // ...
        // default nova routes

        NovaIframePage::make()
            ->setSrc('https://mycoolsite.com')
            ->setPath('custom-iframe-path')
            ->register();
    }

    // ...
}

use Pavloniym\NovaIframePage\NovaIframePage;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    // ...

    /**
     * Get the tools that should be listed in the Nova sidebar.
     *
     * @return array
     */
    public function tools()
    {
        return [
            NovaIframePage::make()
                ->setIcon('server')
                ->setName('My Cool Site')
                ->setPath('custom-iframe-path'),
        ];
    }

    // ...
}

NovaIframePage::make()->setSrc('https://mycoolsite.com');

NovaIframePage::make()->setHeight('600px');

NovaIframePage::make()->setNoScroll(true);

NovaIframePage::make()->setNoTopPadding(true);

NovaIframePage::make()->setNoFrameBorder(true);

NovaIframePage::make()->setWithBorderRadius(true);

NovaIframePage::make()->setIframeStyles([
    'border' => '1px solid #ddd',
    'margin-top' => '20px',
]);

NovaIframePage::make()->setIframeOptions([
    'sandbox' => 'allow-scripts allow-same-origin',
]);

use Pavloniym\NovaIframePage\NovaIframePage;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    protected function routes()
    {
        Nova::routes()
            ->withAuthenticationRoutes()
            ->register();

        NovaIframePage::make()
            ->setPath('/custom-page')
            ->setSrc('https://example.com')
            ->setHeight('700px')
            ->setNoScroll(true)
            ->setNoTopPadding(true)
            ->setNoFrameBorder(true)
            ->setWithBorderRadius(false)
            ->setIframeStyles([
                'border' => '2px solid #333',
                'box-shadow' => '0 0 10px rgba(0, 0, 0, 0.5)',
            ])
            ->setIframeOptions([
                'sandbox' => 'allow-forms allow-popups',
            ])
            ->register();
    }

    public function tools()
    {
        return [
            NovaIframePage::make()
                ->setName('Custom Page')
                ->setPath('/custom-page'),
        ];
    }
}