Implement news management features: add author field and comments functionality in NewsResource, enhance HomePageController to fetch latest news, and create dedicated views for news display and commenting. Update routes for comment submission and adjust homepage to showcase recent news articles.
This commit is contained in:
@@ -15,8 +15,6 @@ use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
class HomePageSettings extends SettingsPage
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-o-home';
|
||||
|
||||
protected static string $settings = HomeSettings::class;
|
||||
|
||||
public function form(Form $form): Form
|
||||
@@ -291,4 +289,4 @@ class HomePageSettings extends SettingsPage
|
||||
{
|
||||
return 'Manage the homepage hero section, background video, and call-to-action content.';
|
||||
}
|
||||
}
|
||||
}
|
||||
40
app/Filament/Pages/ManageCtaSettings.php
Normal file
40
app/Filament/Pages/ManageCtaSettings.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Settings\CtaSettings;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
|
||||
class ManageCtaSettings extends SettingsPage
|
||||
{
|
||||
protected static ?string $navigationGroup = 'CMS';
|
||||
protected static ?string $navigationLabel = 'Call To Action';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-megaphone';
|
||||
|
||||
protected static string $settings = CtaSettings::class;
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('title')
|
||||
->label('Call To Action Title')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('button_text')
|
||||
->label('Button Text')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('button_url')
|
||||
->label('Button URL')
|
||||
->required()
|
||||
->url(),
|
||||
FileUpload::make('background_image')
|
||||
->label('Background Image 1320x408')
|
||||
->directory('settings')
|
||||
->image()
|
||||
->columnSpan('full'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user