PHP code example of rectitude-open / filament-news

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

    

rectitude-open / filament-news example snippets


return [
    'cluster' => [
        'navigation_sort' => 0,
        'navigation_icon' => 'heroicon-o-newspaper',
    ],
    'news' => [
        'navigation_sort' => 0,
        'navigation_icon' => 'heroicon-o-newspaper',
        'datetime_format' => 'Y-m-d H:i:s',
        'navigation_badge' => false,
        'model' => \RectitudeOpen\FilamentNews\Models\News::class,
        'filament_resource' => \RectitudeOpen\FilamentNews\Filament\Resources\NewsResource::class,
    ],
    'news_category' => [
        'model' => \RectitudeOpen\FilamentNews\Models\NewsCategory::class,
        'page' => \RectitudeOpen\FilamentNews\Filament\Pages\NewsCategory::class,
        'navigation_sort' => 2,
        'navigation_icon' => 'heroicon-o-rectangle-stack',
    ],
    'tag' => [
        'model' => \RectitudeOpen\FilamentNews\Models\Tag::class,
        'filament_resource' => \RectitudeOpen\FilamentNews\Filament\Resources\NewsTagResource::class,
        'navigation_sort' => 3,
        'navigation_icon' => 'heroicon-o-tag',
    ],

    'editor_component_class' => \Filament\Forms\Components\RichEditor::class,
];

namespace App\Providers\Filament;

use RectitudeOpen\FilamentNews\FilamentNewsPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                FilamentNewsPlugin::make()
            ]);
    }
}
bash
php artisan vendor:publish --tag="filament-news-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-news-config"
bash
php artisan vendor:publish --tag="filament-news-translations"