| Conditions | 2 |
| Paths | 1 |
| Total Lines | 46 |
| Code Lines | 42 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public static function configure(Schema $schema): Schema |
||
| 16 | { |
||
| 17 | return $schema |
||
| 18 | ->components([ |
||
| 19 | Section::make() |
||
| 20 | ->schema([ |
||
| 21 | Select::make('notification_template_id') |
||
| 22 | ->relationship('template', 'name') |
||
| 23 | ->required() |
||
| 24 | ->searchable(), |
||
| 25 | Select::make('user_id') |
||
| 26 | ->relationship('user', 'name') |
||
| 27 | ->required() |
||
| 28 | ->searchable(), |
||
| 29 | Select::make('channel') |
||
| 30 | ->options([ |
||
| 31 | 'email' => 'Email', |
||
| 32 | 'sms' => 'SMS', |
||
| 33 | 'slack' => 'Slack', |
||
| 34 | 'discord' => 'Discord', |
||
| 35 | 'push' => 'Push Notification', |
||
| 36 | ]) |
||
| 37 | ->required(), |
||
| 38 | TextInput::make('subject') |
||
| 39 | ->maxLength(255), |
||
| 40 | Textarea::make('content') |
||
| 41 | ->rows(10) |
||
| 42 | ->readonly(), |
||
| 43 | KeyValue::make('data') |
||
| 44 | ->keyLabel('Key') |
||
| 45 | ->valueLabel('Value'), |
||
| 46 | Select::make('status') |
||
| 47 | ->options([ |
||
| 48 | 'pending' => 'Pending', |
||
| 49 | 'sent' => 'Sent', |
||
| 50 | 'failed' => 'Failed', |
||
| 51 | ]) |
||
| 52 | ->required(), |
||
| 53 | DateTimePicker::make('scheduled_at') |
||
| 54 | ->readonly(), |
||
| 55 | DateTimePicker::make('sent_at') |
||
| 56 | ->readonly(), |
||
| 57 | Textarea::make('error') |
||
| 58 | ->rows(3) |
||
| 59 | ->readonly() |
||
| 60 | ->visible(fn($record) => $record && $record->status === 'failed'), |
||
| 61 | ]) |
||
| 65 |