Skip to content

Commit fcaad3d

Browse files
authored
Update nova resource for contact #30
1 parent a287ec3 commit fcaad3d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/Nova/Contact.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function fieldsForIndex(NovaRequest $request)
5656
public function fields(Request $request)
5757
{
5858
return array_filter([
59+
Text::make('Number', 'reference_number')->exceptOnForms(),
5960
Enum::make('ContactStatus', function (\Tipoff\Forms\Models\Contact $contact) {
6061
return $contact->getContactStatus();
6162
})->attach(ContactStatus::class),
@@ -67,10 +68,12 @@ public function fields(Request $request)
6768
FormType::EMPLOYMENT => 'Employment',
6869
])->required()->hideWhenUpdating(),
6970
nova('location') ? BelongsTo::make('Location', 'location', nova('location'))->required()->hideWhenUpdating() : null,
71+
Text::make('First Name', 'first_name')->hideWhenUpdating(),
72+
Text::make('Last Name', 'last_name')->hideWhenUpdating(),
7073
nova('user') ? BelongsTo::make('User', 'user', nova('user'))->required()->hideWhenUpdating() : null,
71-
// PhoneNumber::make('Phone')->format('###-###-####')->disableValidation()->useMaskPlaceholder()->linkOnDetail()->hideWhenUpdating(),
7274
nova('email_address') ? BelongsTo::make('Email Address', 'email_address', nova('email_address'))->sortable() : null,
73-
Textarea::make('Message')->rows(3)->alwaysShow()->nullable()->hideWhenUpdating(),
75+
nova('phone') ? BelongsTo::make('Phone', 'phone', nova('phone'))->sortable() : null,
76+
Text::make('Company Name')->nullable()->hideWhenUpdating(),
7477

7578
new Panel('Submission Details', $this->submissionFields()),
7679

@@ -81,20 +84,19 @@ public function fields(Request $request)
8184
protected function submissionFields()
8285
{
8386
return [
84-
Text::make('Number', 'reference_number')->exceptOnForms(),
87+
Textarea::make('Message')->rows(3)->alwaysShow()->nullable()->hideWhenUpdating(),
8588
Number::make('Participants', 'fields->participants')->nullable()->hideWhenUpdating(),
8689
Date::make('Requested Date', 'fields->requested_date')->nullable()->hideWhenUpdating(),
8790
Text::make('Requested Time', 'fields->requested_time')->nullable()->hideWhenUpdating(),
88-
Text::make('Company Name')->nullable()->hideWhenUpdating(),
8991
];
9092
}
9193

9294
protected function dataFields(): array
9395
{
94-
return [
95-
ID::make(),
96-
DateTime::make('Created At')->exceptOnForms(),
97-
DateTime::make('Updated At')->exceptOnForms(),
98-
];
96+
return array_merge(
97+
parent::dataFields(),
98+
$this->creatorDataFields(),
99+
$this->updaterDataFields(),
100+
);
99101
}
100102
}

0 commit comments

Comments
 (0)