PHP code example of gigabait93 / filament-pages

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

    

gigabait93 / filament-pages example snippets




return [
    // Group label for pages in the Filament admin navigation. Set to
    // `null` to display pages without a group.
    'admin_navigation_group' => null,

    // Position of the pages group within the admin navigation menu.
    'admin_navigation_order' => 5,

    // Icon for the pages group in the admin navigation menu.
    'admin_navigation_icon' => 'heroicon-o-document-text',


    // Filament panel identifiers that should register the client-side
    // plugin. Uncomment and list your panel IDs below.
    'clients_panels_ids' => [
        // 'client',
    ],

    // The Eloquent model representing application users.
    'user_model' => \App\Models\User::class,
];

use Gigabait93\FilamentPages\AdminPagesPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(AdminPagesPlugin::make());
}

use Gigabait93\FilamentPages\ClientPagesPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(ClientPagesPlugin::make());
}

'providers' => [
    // ...
    Gigabait93\FilamentPages\Providers\FilamentPagesServiceProvider::class,
],

$blocks = page_normalize_blocks($page->content);

$url = page_media_url($imagePath, 'public');

$templates = templatesOptions();

$icons = iconsOptions();

use Gigabait93\FilamentPages\Pages\Show;

Route::get('/p/{slug?}', Show::class)->name('pages.show');
bash
php artisan vendor:publish --tag="filament-pages-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-pages-config"
bash
php artisan vendor:publish --tag="filament-pages-views"
bash
php artisan vendor:publish --tag="filament-pages-translations"

resources/views/vendor/pages/blocks/
├── custom-template/
│   ├── text.blade.php
│   ├── image.blade.php
│   └── gallery.blade.php
bash
php artisan vendor:publish --tag="filament-pages-views"

resources/views/vendor/pages/show.blade.php