You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ViewClient.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace App\Filament\Company\Resources\Sales\ClientResource\Pages;
  3. use App\Filament\Company\Resources\Sales\ClientResource;
  4. use App\Filament\Company\Resources\Sales\ClientResource\RelationManagers;
  5. use Filament\Infolists\Components\Section;
  6. use Filament\Infolists\Components\TextEntry;
  7. use Filament\Infolists\Infolist;
  8. use Filament\Resources\Pages\ViewRecord;
  9. use Illuminate\Contracts\Support\Htmlable;
  10. class ViewClient extends ViewRecord
  11. {
  12. protected static string $resource = ClientResource::class;
  13. public function getRelationManagers(): array
  14. {
  15. return [
  16. RelationManagers\InvoicesRelationManager::class,
  17. RelationManagers\RecurringInvoicesRelationManager::class,
  18. RelationManagers\EstimatesRelationManager::class,
  19. ];
  20. }
  21. public function getTitle(): string | Htmlable
  22. {
  23. return $this->record->name;
  24. }
  25. protected function getHeaderWidgets(): array
  26. {
  27. return [
  28. ClientResource\Widgets\InvoiceOverview::class,
  29. ];
  30. }
  31. public function infolist(Infolist $infolist): Infolist
  32. {
  33. return $infolist
  34. ->schema([
  35. Section::make('General')
  36. ->columns()
  37. ->schema([
  38. TextEntry::make('primaryContact.full_name')
  39. ->label('Primary Contact'),
  40. TextEntry::make('primaryContact.email')
  41. ->label('Primary Email'),
  42. TextEntry::make('primaryContact.first_available_phone')
  43. ->label('Primary Phone'),
  44. TextEntry::make('website')
  45. ->label('Website')
  46. ->url(static fn ($state) => $state, true),
  47. ]),
  48. Section::make('Additional Details')
  49. ->columns()
  50. ->schema([
  51. TextEntry::make('billingAddress.address_string')
  52. ->label('Billing Address')
  53. ->listWithLineBreaks(),
  54. TextEntry::make('shippingAddress.address_string')
  55. ->label('Shipping Address')
  56. ->listWithLineBreaks(),
  57. TextEntry::make('notes')
  58. ->label('Delivery Instructions'),
  59. ]),
  60. ]);
  61. }
  62. }