messages
This commit is contained in:
1 parent
a159fe4cd5
commit
7834ed84b0
1 file changed
+3
-5
@@ -8,7 +8,6 @@ use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
@@ -42,9 +41,8 @@ class UserNotifications extends Component implements HasActions, HasSchemas, Has
|
||||
->required()
|
||||
->options(fn () => User::query()->where('client_id', auth()->user()->client_id)->orwhereIn('id', [1, 2])->pluck('name', 'id')),
|
||||
Toggle::make('notify_by_email')->label('Send also as E-Mail'),
|
||||
TextInput::make('subject')
|
||||
Textarea::make('message')->rows(4)
|
||||
->required(),
|
||||
Textarea::make('message')->rows(4),
|
||||
])
|
||||
->statePath('data');
|
||||
}
|
||||
@@ -60,9 +58,9 @@ class UserNotifications extends Component implements HasActions, HasSchemas, Has
|
||||
Mail::to($recipient)->send(new UserNotification($data['subject'], $data['message']));
|
||||
}
|
||||
Notification::make()
|
||||
->title($data['subject'])
|
||||
->title($data['message'])
|
||||
->icon('phosphor-user-duotone')
|
||||
->body('from: '.auth()->user()->name.'<br>'.$data['message'])
|
||||
->body('from: '.auth()->user()->name)
|
||||
->sendToDatabase($recipient);
|
||||
|
||||
Notification::make()
|
||||
|
||||
Reference in new issue
Block a user