diff --git a/app/Models/Service/Phone.php b/app/Models/Service/Phone.php index 6ecf206..874eaf7 100644 --- a/app/Models/Service/Phone.php +++ b/app/Models/Service/Phone.php @@ -48,4 +48,23 @@ class Phone extends Type { return $value ?: $this->supplied()->technology; } + + /* OVERRIDES */ + + /** + * Service update validation + * + * @return array + */ + public function validation(): array + { + return [ + 'service_number' => 'nullable|string|min:10|max:10', + 'service_username' => 'nullable|string', + 'service_password' => 'nullable|string', + 'connect_at' => 'nullable|date', + 'start_at' => 'nullable|date', + 'expire_at' => 'nullable|date|after:start_at', + ]; + } } \ No newline at end of file diff --git a/resources/views/theme/backend/adminlte/service/widget/phone/update.blade.php b/resources/views/theme/backend/adminlte/service/widget/phone/update.blade.php index 34d9746..47ab79f 100644 --- a/resources/views/theme/backend/adminlte/service/widget/phone/update.blade.php +++ b/resources/views/theme/backend/adminlte/service/widget/phone/update.blade.php @@ -1,72 +1,74 @@ - -
- -
-
-
- -
- -
+ +
+
+ @include('adminlte::widget.form_text',[ + 'label'=>'Service Number', + 'icon'=>'fas fa-phone', + 'id'=>'service_number', + 'old'=>'phone.service_number', + 'name'=>'phone[service_number]', + 'value'=>$o->service_number ?? '', + ])
-
- -
-
-
- -
- -
+
+
+ @include('adminlte::widget.form_text',[ + 'label'=>'Service Username', + 'icon'=>'fas fa-user', + 'id'=>'service_username', + 'old'=>'phone.service_username', + 'name'=>'phone[service_username]', + 'value'=>$o->service_username ?? '', + ]) +
+ +
+ @include('adminlte::widget.form_text',[ + 'label'=>'Service Password', + 'icon'=>'fas fa-lock', + 'id'=>'service_password', + 'old'=>'phone.service_password', + 'name'=>'phone[service_password]', + 'value'=>$o->service_password ?? '', + ])
-
- -
-
-
- -
- -
+
+

Service Dates

+ +
+
+ @include('adminlte::widget.form_date',[ + 'label'=>'Connect Date', + 'id'=>'connect_at', + 'old'=>'phone.connect_at', + 'name'=>'phone[connect_at]', + 'value'=>$o->connect_at ? $o->connect_at->format('Y-m-d') : '', + ]) +
+ +
+ @include('adminlte::widget.form_date',[ + 'label'=>'Billing Start Date', + 'id'=>'start_at', + 'old'=>'phone.start_at', + 'name'=>'phone[start_at]', + 'value'=>$o->start_at ? $o->start_at->format('Y-m-d') : ($o->connect_at ? $o->connect_at->format('Y-m-d') : ''), + ])
-
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
+
+
+ @include('adminlte::widget.form_date',[ + 'label'=>'Contract End', + 'id'=>'expire_at', + 'old'=>'phone.expire_at', + 'name'=>'phone[expire_at]', + 'value'=>$o->expire_at ? $o->expire_at->format('Y-m-d') : ($o->connect_at ? $o->connect_at->addMonths($o->contract_term)->format('Y-m-d') : ''), + ])
\ No newline at end of file