generateNavigationItems([ ViewClient::class, EditClient::class, GeneralLedger::class, TrialBalance::class, ]); } public static function form(Form $form): Form { return $form ->schema([ Forms\Components\TextInput::make('firstname')->label('First Name')->required(), Forms\Components\TextInput::make('middlename')->label('Middle Name')->nullable(), Forms\Components\TextInput::make('lastname')->label('Last Name')->required(), Forms\Components\Grid::make()->schema([ Forms\Components\TextInput::make('company')->label('Company')->required(), Forms\Components\Select::make('type_id') ->relationship('type', 'type') ->label('Type')->required(), ])->columns(2), ])->columns(3); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('firstname')->label('First Name')->searchable(), Tables\Columns\TextColumn::make('middlename')->label('Middle Name'), Tables\Columns\TextColumn::make('lastname')->label('Last Name'), Tables\Columns\TextColumn::make('company')->label('Company')->searchable(), Tables\Columns\TextColumn::make('type.type')->label('Type'), ]) ->filters([ Tables\Filters\Filter::make('Vatable') ->query(fn (Builder $query) => $query->orWhereHas('type', function (Builder $query) { $query->where('type', 'Vatable'); })), Tables\Filters\Filter::make('Non-Vatable') ->query(fn (Builder $query) => $query->orWhereHas('type', function (Builder $query) { $query->where('type', 'Non Vatable'); })), ]) ->actions([ Tables\Actions\ViewAction::make(), Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make()->requiresConfirmation(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ AccountsRelationManager::class, BranchesRelationManager::class, TransmittalsRelationManager::class, SalesRelationManager::class, ExpensesRelationManager::class, JournalsRelationManager::class, ]; } public static function getPages(): array { return [ 'view' => ViewClient::route('/{record}'), 'edit' => EditClient::route('/{record}/edit'), 'index' => ListClients::route('/'), 'general-ledger' => GeneralLedger::route('/{record}/general-ledger'), 'trial-balance' => TrialBalance::route('/{record}/trial-balance'), ]; } public static function saveBranch($data): Branch { $createBranchProcess = new CreateBranchProcess; $payload = new CreateBranchDTO(data: $data); return $createBranchProcess->run($payload)->branch; } }