// app/Filament/Resources/BranchResource.php namespace App\Filament\Resources; use App\Filament\Resources\BranchResource\Pages; use App\Models\Branch; use Filament\Forms; use Filament\Tables; use Filament\Resources\Resource; class BranchResource extends Resource { protected static ?string $model = Branch::class; protected static ?string $navigationIcon = 'heroicon-o-map-pin'; public static function form(Forms\Form $form): Forms\Form { return $form->schema([ Forms\Components\TextInput::make('name')->required(), Forms\Components\TextInput::make('phone'), Forms\Components\Textarea::make('address'), Forms\Components\TextInput::make('daily_capacity') ->numeric() ->default(50) ->label('السعة اليومية (سيارة)'), Forms\Components\Toggle::make('is_active')->label('نشط')->default(true), ]); } public static function table(Tables\Table $table): Tables\Table { return $table->columns([ Tables\Columns\TextColumn::make('name')->searchable(), Tables\Columns\TextColumn::make('daily_capacity'), Tables\Columns\IconColumn::make('is_active')->boolean(), ]); } }// app/Filament/Resources/VehicleResource.php namespace App\Filament\Resources; use App\Models\Vehicle; use Filament\Forms; use Filament\Tables; use Filament\Resources\Resource; class VehicleResource extends Resource { protected static ?string $model = Vehicle::class; protected static ?string $navigationIcon = 'heroicon-o-truck'; public static function form(Forms\Form $form): Forms\Form { return $form->schema([ Forms\Components\Select::make('make_id')->relationship('make', 'name')->required(), Forms\Components\Select::make('model_id')->relationship('model', 'name')->required(), Forms\Components\TextInput::make('plate_no')->label('رقم اللوحة')->unique(ignoreRecord: true), Forms\Components\TextInput::make('vin')->label('رقم الشاسيه')->unique(ignoreRecord: true), Forms\Components\TextInput::make('current_km')->numeric()->label('العداد الحالي'), ]); } public static function table(Tables\Table $table): Tables\Table { return $table->columns([ Tables\Columns\TextColumn::make('plate_no')->searchable(), Tables\Columns\TextColumn::make('make.name'), Tables\Columns\TextColumn::make('model.name'), Tables\Columns\TextColumn::make('currentOwner.name')->label('المالك الحالي'), ]); } }// app/Filament/Resources/WorkOrderResource.php namespace App\Filament\Resources; use App\Models\WorkOrder; use App\Services\LoyaltyService; use App\Services\ReminderService; use Filament\Forms; use Filament\Tables; use Filament\Resources\Resource; use Filament\Notifications\Notification; class WorkOrderResource extends Resource { protected static ?string $model = WorkOrder::class; protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-list'; public static function table(Tables\Table $table): Tables\Table { return $table->columns([ Tables\Columns\TextColumn::make('invoice_no')->label('رقم الفاتورة')->searchable(), Tables\Columns\TextColumn::make('vehicle.plate_no'), Tables\Columns\BadgeColumn::make('status') ->colors([ 'warning' => 'received', 'info' => 'under_repair', 'success' => 'delivered', ]), Tables\Columns\TextColumn::make('total_amount')->money('LYD'), ])->actions([ Tables\Actions\Action::make('close_order') ->label('إقفال الأمر') ->icon('heroicon-o-check-circle') ->visible(fn ($record) => $record->status !== 'delivered') ->form([ Forms\Components\TextInput::make('invoice_no')->required()->unique('work_orders', 'invoice_no'), Forms\Components\TextInput::make('total_amount')->numeric()->required(), Forms\Components\Select::make('service_types') ->multiple() ->relationship('services', 'name') ->label('أنواع الصيانة المنفذة'), Forms\Components\Textarea::make('work_summary')->label('ملخص العمل'), ]) ->action(function (WorkOrder $record, array $data) { // تحديث الحالة والبيانات $record->update([ 'status' => 'delivered', 'closed_at' => now(), 'invoice_no' => $data['invoice_no'], 'total_amount' => $data['total_amount'], 'paid_amount' => $data['total_amount'] - $record->discount_points_amount, 'payment_status' => 'paid', 'work_summary' => $data['work_summary'], ]); // ربط الخدمات $record->services()->sync($data['service_types']); // 🚀 استدعاء خدمات النقاط والتنبيهات $loyaltyService = app(LoyaltyService::class); $reminderService = app(ReminderService::class); $loyaltyService->earnPoints($record, $record->paid_amount); $reminderService->recalculateReminders($record->vehicle, $data['service_types']); Notification::make() ->title('تم إقفال الأمر بنجاح') ->success() ->send(); }), ]); } }// app/Filament/Pages/Settings.php namespace App\Filament\Pages; use App\Models\Setting; use Filament\Pages\Page; use Filament\Forms\Contracts\HasForms; use Filament\Forms\Concerns\InteractsWithForms; class Settings extends Page implements HasForms { use InteractsWithForms; protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth'; protected static string $view = 'filament.pages.settings'; public $working_start = '09:00'; public $working_end = '16:00'; public $points_percent = 1; public $redeem_max_percent = 30; public function mount(): void { $this->working_start = Setting::get('working_start', '09:00'); $this->working_end = Setting::get('working_end', '16:00'); $this->points_percent = Setting::get('points_percent', 1); $this->redeem_max_percent = Setting::get('redeem_max_percent', 30); } public function save(): void { Setting::updateOrCreate(['key' => 'working_start'], ['value' => $this->working_start]); Setting::updateOrCreate(['key' => 'working_end'], ['value' => $this->working_end]); Setting::updateOrCreate(['key' => 'points_percent'], ['value' => $this->points_percent]); Setting::updateOrCreate(['key' => 'redeem_max_percent'], ['value' => $this->redeem_max_percent]); $this->notify('success', 'تم حفظ الإعدادات بنجاح.'); } } Car Service

Let's get started

With so many options available to you,
we suggest you start with the following:

v13.36.0 View changelog