diff --git a/app/Filament/Pages/HomePageSettings.php b/app/Filament/Pages/HomePageSettings.php index 5644407..457a32f 100644 --- a/app/Filament/Pages/HomePageSettings.php +++ b/app/Filament/Pages/HomePageSettings.php @@ -3,14 +3,13 @@ namespace App\Filament\Pages; use App\Settings\HomeSettings; -use Filament\Forms\Components\Grid; -use Filament\Forms\Components\Section; -use Filament\Forms\Components\TextInput; -use Filament\Forms\Components\Textarea; use Filament\Forms\Components\FileUpload; +use Filament\Forms\Components\Grid; use Filament\Forms\Components\Repeater; +use Filament\Forms\Components\Section; +use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; use Filament\Forms\Form; -use Filament\Pages\Page; use Filament\Pages\SettingsPage; use Illuminate\Contracts\Support\Htmlable; @@ -81,19 +80,19 @@ class HomePageSettings extends SettingsPage ->label('Projects Number') ->numeric() ->required(), - + ])->columns(2), Grid::make()->schema([ TextInput::make('about_members_text') ->label('Members Text') ->maxLength(100) ->required(), - + TextInput::make('about_members_number') ->label('Members Number') ->numeric() ->required(), - + ])->columns(2), Grid::make()->schema([ @@ -106,7 +105,7 @@ class HomePageSettings extends SettingsPage ->label('Reviews Number') ->numeric() ->required(), - + ])->columns(2), Grid::make()->schema([ TextInput::make('about_button_text') @@ -148,7 +147,7 @@ class HomePageSettings extends SettingsPage ->url() ->required(), ]), - + Section::make('Industry Area') ->description('Manage the content for the industry area section.') ->icon('heroicon-o-building-office') diff --git a/app/Filament/Pages/ManagePortfolio.php b/app/Filament/Pages/ManagePortfolio.php index fb08872..2687c70 100644 --- a/app/Filament/Pages/ManagePortfolio.php +++ b/app/Filament/Pages/ManagePortfolio.php @@ -3,11 +3,11 @@ namespace App\Filament\Pages; use App\Settings\PortfolioSettings; +use Filament\Forms\Components\FileUpload; use Filament\Forms\Components\Grid; +use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Section; use Filament\Forms\Components\TextInput; -use Filament\Forms\Components\FileUpload; -use Filament\Forms\Components\Repeater; use Filament\Forms\Form; use Filament\Pages\SettingsPage; use Illuminate\Contracts\Support\Htmlable; @@ -33,9 +33,11 @@ class ManagePortfolio extends SettingsPage Grid::make()->schema([ TextInput::make('portfolio_button_text') ->label('Button Text') + ->required() ->maxLength(50), TextInput::make('portfolio_button_url') ->label('Button URL') + ->required() ->maxLength(255) ->url(), ])->columns(2), @@ -49,7 +51,8 @@ class ManagePortfolio extends SettingsPage ->schema([ FileUpload::make('image') ->label('Image (700x525)') - ->image() ->maxSize(2048) + ->image() + ->maxSize(2048) ->disk('public') ->directory('portfolio-images') ->required(), @@ -103,4 +106,4 @@ class ManagePortfolio extends SettingsPage { return 'Manage the portfolio section content, including items, categories, and titles.'; } -} \ No newline at end of file +} diff --git a/app/Filament/Pages/ManageSite.php b/app/Filament/Pages/ManageSite.php index cacdc03..15a85e7 100644 --- a/app/Filament/Pages/ManageSite.php +++ b/app/Filament/Pages/ManageSite.php @@ -38,10 +38,12 @@ class ManageSite extends SettingsPage ->maxLength(100), Forms\Components\TextInput::make('tagline') ->label('Site Tagline') + ->required() ->helperText('A short phrase describing your site') ->maxLength(150), Forms\Components\Textarea::make('description') ->label('Site Description') + ->required() ->helperText('A detailed description of your website') ->rows(3) ->maxLength(500), @@ -65,13 +67,16 @@ class ManageSite extends SettingsPage ->maxLength(100), Forms\Components\TextInput::make('company_phone') ->label('Company Phone') + ->required() ->maxLength(20), Forms\Components\TextInput::make('company_phone_2') ->label('Company Additional Phone') + ->required() ->maxLength(20), ])->columns(2), Forms\Components\Textarea::make('company_address') ->label('Company Address') + ->required() ->rows(2) ->maxLength(200), ]), @@ -94,17 +99,20 @@ class ManageSite extends SettingsPage ->schema([ Forms\Components\TextInput::make('copyright_text') ->label('Copyright Text') + ->required() ->maxLength(200), Forms\Components\Grid::make()->schema([ Forms\Components\TextInput::make('terms_url') ->label('Terms & Conditions URL') + ->required() ->maxLength(100) ->prefix(function (Forms\Get $get) { return url('/'); }), Forms\Components\TextInput::make('privacy_url') ->label('Privacy Policy URL') + ->required() ->maxLength(100) ->prefix(function (Forms\Get $get) { return url('/'); @@ -120,10 +128,12 @@ class ManageSite extends SettingsPage Forms\Components\Grid::make()->schema([ Forms\Components\Textarea::make('custom_404_message') ->label('404 Not Found Message') + ->required() ->rows(2) ->maxLength(500), Forms\Components\Textarea::make('custom_500_message') ->label('500 Server Error Message') + ->required() ->rows(2) ->maxLength(500), ])->columns(2), diff --git a/app/Filament/Pages/ManageSiteSocialSettings.php b/app/Filament/Pages/ManageSiteSocialSettings.php index 911bc9a..d601a4c 100644 --- a/app/Filament/Pages/ManageSiteSocialSettings.php +++ b/app/Filament/Pages/ManageSiteSocialSettings.php @@ -28,18 +28,22 @@ class ManageSiteSocialSettings extends SettingsPage Forms\Components\Grid::make()->schema([ Forms\Components\TextInput::make('facebook_url') ->label('Facebook URL') + ->required() ->prefix('https://') ->helperText('e.g., facebook.com/yourpage'), Forms\Components\TextInput::make('twitter_url') ->label('Twitter/X URL') + ->required() ->prefix('https://') ->helperText('e.g., twitter.com/yourusername'), Forms\Components\TextInput::make('instagram_url') ->label('Instagram URL') + ->required() ->prefix('https://') ->helperText('e.g., instagram.com/yourusername'), Forms\Components\TextInput::make('linkedin_url') ->label('LinkedIn URL') + ->required() ->prefix('https://') ->helperText('e.g., linkedin.com/company/yourcompany'), ])->columns(2), diff --git a/app/Filament/Pages/ManageSolutions.php b/app/Filament/Pages/ManageSolutions.php index b76d2bc..50df9ed 100644 --- a/app/Filament/Pages/ManageSolutions.php +++ b/app/Filament/Pages/ManageSolutions.php @@ -4,12 +4,10 @@ namespace App\Filament\Pages; use App\Settings\SolutionSettings; use Filament\Forms\Components\Grid; +use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Section; use Filament\Forms\Components\TextInput; -use Filament\Forms\Components\Textarea; -use Filament\Forms\Components\Repeater; use Filament\Forms\Form; -use Filament\Pages\Page; use Filament\Pages\SettingsPage; use Illuminate\Contracts\Support\Htmlable; @@ -29,6 +27,7 @@ class ManageSolutions extends SettingsPage ->schema([ TextInput::make('solutions_subtitle') ->label('Subtitle') + ->required() ->maxLength(100), TextInput::make('solutions_header') ->label('Header') @@ -37,9 +36,11 @@ class ManageSolutions extends SettingsPage Grid::make()->schema([ TextInput::make('solutions_button_text') ->label('Button Text') + ->required() ->maxLength(50), TextInput::make('solutions_button_url') ->label('Button URL') + ->required() ->maxLength(255) ->url(), ])->columns(2), @@ -103,4 +104,4 @@ class ManageSolutions extends SettingsPage { return 'Manage the solutions section content, including individual solution items.'; } -} \ No newline at end of file +} diff --git a/app/Filament/Pages/ManageSuccess.php b/app/Filament/Pages/ManageSuccess.php index 329c1d9..2955864 100644 --- a/app/Filament/Pages/ManageSuccess.php +++ b/app/Filament/Pages/ManageSuccess.php @@ -4,10 +4,10 @@ namespace App\Filament\Pages; use App\Settings\SuccessSettings; use Filament\Forms\Components\Grid; -use Filament\Forms\Components\Section; -use Filament\Forms\Components\TextInput; -use Filament\Forms\Components\Textarea; use Filament\Forms\Components\Repeater; +use Filament\Forms\Components\Section; +use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Pages\SettingsPage; use Illuminate\Contracts\Support\Htmlable; @@ -28,6 +28,7 @@ class ManageSuccess extends SettingsPage ->schema([ TextInput::make('success_subtitle') ->label('Subtitle') + ->required() ->maxLength(100), TextInput::make('success_header') ->label('Header') @@ -35,14 +36,17 @@ class ManageSuccess extends SettingsPage ->maxLength(255), Textarea::make('success_paragraph') ->label('Paragraph') + ->required() ->rows(3) ->maxLength(65535), Grid::make()->schema([ TextInput::make('success_button_text') ->label('Button Text') + ->required() ->maxLength(50), TextInput::make('success_button_url') ->label('Button URL') + ->required() ->maxLength(255) ->url(), ])->columns(2), @@ -101,4 +105,4 @@ class ManageSuccess extends SettingsPage { return 'Manage the success section content, including text, button, and skill bars.'; } -} \ No newline at end of file +} diff --git a/app/Filament/Resources/BrandResource.php b/app/Filament/Resources/BrandResource.php index 0ebe6d7..3bdd5ec 100644 --- a/app/Filament/Resources/BrandResource.php +++ b/app/Filament/Resources/BrandResource.php @@ -3,9 +3,7 @@ namespace App\Filament\Resources; use App\Filament\Resources\BrandResource\Pages; -use App\Filament\Resources\BrandResource\RelationManagers; use App\Models\Brand; -use Filament\Forms; use Filament\Forms\Components\FileUpload; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; @@ -16,8 +14,6 @@ use Filament\Tables\Columns\ImageColumn; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Columns\ToggleColumn; use Filament\Tables\Table; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\SoftDeletingScope; class BrandResource extends Resource { @@ -36,12 +32,12 @@ class BrandResource extends Resource FileUpload::make('image') ->image() ->imageEditor() - ->rules(['required', 'image',]), + ->rules(['required', 'image']), Toggle::make('active') ->label('Is active') ->onColor('success') - ->offColor('danger') + ->offColor('danger'), ]); } diff --git a/app/Filament/Resources/NewsResource.php b/app/Filament/Resources/NewsResource.php new file mode 100644 index 0000000..0c99568 --- /dev/null +++ b/app/Filament/Resources/NewsResource.php @@ -0,0 +1,114 @@ +schema([ + Forms\Components\Card::make() + ->schema([ + TextInput::make('title') + ->required() + ->maxLength(255) + ->reactive() + ->afterStateUpdated(fn (string $operation, $state, Forms\Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null), + TextInput::make('slug') + ->required() + ->maxLength(255) + ->disabled() + ->dehydrated() + ->unique(News::class, 'slug', ignoreRecord: true), + FileUpload::make('image') + ->image() + ->directory('news') + ->nullable() + ->columnSpanFull(), + RichEditor::make('content') + ->required() + ->columnSpanFull(), + DateTimePicker::make('published_at') + ->required() + ->default(now()), + ]) + ->columns(2), + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + ImageColumn::make('image') + ->square() + ->toggleable(isToggledHiddenByDefault: true), + Tables\Columns\TextColumn::make('title') + ->searchable() + ->sortable(), + Tables\Columns\TextColumn::make('slug') + ->searchable() + ->sortable(), + Tables\Columns\TextColumn::make('published_at') + ->dateTime() + ->sortable(), + Tables\Columns\TextColumn::make('created_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + Tables\Columns\TextColumn::make('updated_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + Tables\Actions\DeleteAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListNews::route('/'), + 'create' => Pages\CreateNews::route('/create'), + 'edit' => Pages\EditNews::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/NewsResource/Pages/CreateNews.php b/app/Filament/Resources/NewsResource/Pages/CreateNews.php new file mode 100644 index 0000000..0cee03f --- /dev/null +++ b/app/Filament/Resources/NewsResource/Pages/CreateNews.php @@ -0,0 +1,11 @@ + */ protected $casts = [ @@ -40,6 +41,6 @@ class Brand extends Model */ public function imageUrl(): string { - return url('/storage/' . $this->image); + return url('/storage/'.$this->image); } } diff --git a/app/Models/News.php b/app/Models/News.php index b8ee6f1..d9f6270 100644 --- a/app/Models/News.php +++ b/app/Models/News.php @@ -13,6 +13,7 @@ class News extends Model 'title', 'slug', 'content', + 'image', 'published_at', ]; -} \ No newline at end of file +} diff --git a/app/Models/Solution.php b/app/Models/Solution.php index cab9c8f..b33d677 100644 --- a/app/Models/Solution.php +++ b/app/Models/Solution.php @@ -14,4 +14,4 @@ class Solution extends Model 'description', 'slug', ]; -} \ No newline at end of file +} diff --git a/app/Models/Story.php b/app/Models/Story.php index ea4b429..743af18 100644 --- a/app/Models/Story.php +++ b/app/Models/Story.php @@ -15,4 +15,4 @@ class Story extends Model 'content', 'published_at', ]; -} \ No newline at end of file +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index fddf257..ba05064 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,11 +2,9 @@ namespace App\Providers; -use App\Models\Brand; use App\Settings\SiteSettings; use App\Settings\SiteSocialSettings; use Illuminate\Database\Eloquent\Model; -use App\Settings\HomeSettings; use Illuminate\Support\Facades\View as ViewFacade; use Illuminate\Support\ServiceProvider; use Illuminate\View\View; diff --git a/app/Settings/PortfolioSettings.php b/app/Settings/PortfolioSettings.php index f94f224..93f1dcb 100644 --- a/app/Settings/PortfolioSettings.php +++ b/app/Settings/PortfolioSettings.php @@ -18,4 +18,4 @@ class PortfolioSettings extends Settings { return 'cms_portfolio'; } -} \ No newline at end of file +} diff --git a/app/Settings/SolutionSettings.php b/app/Settings/SolutionSettings.php index 4381425..3e9d6d0 100644 --- a/app/Settings/SolutionSettings.php +++ b/app/Settings/SolutionSettings.php @@ -20,4 +20,4 @@ class SolutionSettings extends Settings { return 'cms_solutions'; } -} \ No newline at end of file +} diff --git a/app/Settings/SuccessSettings.php b/app/Settings/SuccessSettings.php index ec58561..30a5bee 100644 --- a/app/Settings/SuccessSettings.php +++ b/app/Settings/SuccessSettings.php @@ -22,4 +22,4 @@ class SuccessSettings extends Settings { return 'cms_success'; } -} \ No newline at end of file +} diff --git a/database/migrations/2025_07_28_121928_create_news_table.php b/database/migrations/2025_07_28_121928_create_news_table.php index dab2a32..032707c 100644 --- a/database/migrations/2025_07_28_121928_create_news_table.php +++ b/database/migrations/2025_07_28_121928_create_news_table.php @@ -13,6 +13,11 @@ return new class extends Migration { Schema::create('news', function (Blueprint $table) { $table->id(); + $table->string('title'); + $table->string('slug')->unique(); + $table->longText('content'); + $table->string('image')->nullable(); + $table->timestamp('published_at'); $table->timestamps(); }); } diff --git a/database/seeders/BrandTableSeeder.php b/database/seeders/BrandTableSeeder.php index 695ba96..97c5fad 100644 --- a/database/seeders/BrandTableSeeder.php +++ b/database/seeders/BrandTableSeeder.php @@ -3,7 +3,6 @@ namespace Database\Seeders; use App\Models\Brand; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\File; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 0532e6e..69d87ae 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -2,7 +2,6 @@ namespace Database\Seeders; -use App\Models\User; // use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; diff --git a/database/seeders/UsersTableSeeder.php b/database/seeders/UsersTableSeeder.php index 3fdfb2c..75742aa 100644 --- a/database/seeders/UsersTableSeeder.php +++ b/database/seeders/UsersTableSeeder.php @@ -2,8 +2,8 @@ namespace Database\Seeders; -use Illuminate\Database\Seeder; use App\Models\User; +use Illuminate\Database\Seeder; class UsersTableSeeder extends Seeder { diff --git a/resources/views/web/pages/home/index.blade.php b/resources/views/web/pages/home/index.blade.php index 4beaebc..6092b29 100644 --- a/resources/views/web/pages/home/index.blade.php +++ b/resources/views/web/pages/home/index.blade.php @@ -245,7 +245,7 @@ @foreach($homeSettings->industry_items as $item)
- image + image
{{ $item['title'] }}

{{ $item['description'] }}

@@ -293,14 +293,14 @@
diff --git a/resources/views/web/pages/news/index.blade.php b/resources/views/web/pages/news/index.blade.php index 6bf0c97..2bff747 100644 --- a/resources/views/web/pages/news/index.blade.php +++ b/resources/views/web/pages/news/index.blade.php @@ -1 +1,128 @@ -w \ No newline at end of file +@extends('web.layouts.app') + +@section('content') + + + + +
+
+
+ @foreach ($allNews as $news) +
+
+
+ image +
+
{{ \Carbon\Carbon::parse($news->published_at)->format('d M') }}
+
+
+ +
+
+ @endforeach + +
+ +
+
+ +
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+ +@endsection \ No newline at end of file