]> _ Git - psq.git/commitdiff
add last mail
authorLouis Jeckel <louis.jeckel@outlook.cm>
Thu, 24 Sep 2020 10:53:16 +0000 (12:53 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Thu, 24 Sep 2020 10:53:16 +0000 (12:53 +0200)
app/MailgunEvent.php
app/Nova/User.php

index e5b4919b741d0fabf0223341ca547bf242bb8cb3..99c5fc0d0fc7900fe574a57b95b733194fad6eaf 100644 (file)
@@ -49,7 +49,7 @@ class MailgunEvent extends Model
             'label' => 'Annulé'
         ],
         'unknown' => [
-            'badge' => 'info',
+            'badge' => 'warning',
             'label' => 'Inconnu'
         ]
     ];
index c6fb07a14e2eb843c10ab0391c0cd72ee69741ed..ac29fe409e332dc25002405f0b06466b41d5a6ac 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace App\Nova;
 
+use App\MailgunEvent;
 use App\Nova\Actions\ImportUsers;
 use App\Nova\Actions\SendNotification;
 use App\Nova\Actions\StartTrial;
@@ -80,6 +81,7 @@ class User extends Resource
             Text::make('Email')->required(),
             Text::make('Position'),
             Text::make('Téléphone', 'phone'),
+
             new Panel('Adresse', $this->addressFields()),
             new Panel('Réglages', [
                 Select::make('Type')->options([
@@ -96,6 +98,8 @@ class User extends Resource
                 BelongsTo::make('Organisation', 'organization', Organization::class)->searchable()->nullable(),
             ]),
         ], $this->extraFields(), [
+            Badge::make('Etat dernier mail', fn() => MailgunEvent::STATUSES[$this->lastMailgunEvent->event ?? 'unknown']['label'])
+                ->map(Arr::pluck(MailgunEvent::STATUSES, 'badge', 'label')),
             Badge::make('Etat', fn() => AppUser::STATUSES[$this->status]['label'])
                 ->map(Arr::pluck(AppUser::STATUSES, 'badge', 'label')),
         ]);