mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 07:22:34 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Models\NotificationChannel;
|
||||
use App\Models\User;
|
||||
use App\NotificationChannels\Email;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
@ -33,7 +34,7 @@ public function add(User $user, array $input): void
|
||||
if (! $channel->provider()->connect()) {
|
||||
$channel->delete();
|
||||
|
||||
if ($channel->provider === \App\Enums\NotificationChannel::EMAIL) {
|
||||
if ($channel->provider === Email::id()) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => __('Could not connect! Make sure you configured `.env` file correctly.'),
|
||||
]);
|
||||
@ -64,7 +65,7 @@ public static function rules(array $input): array
|
||||
$rules = [
|
||||
'provider' => [
|
||||
'required',
|
||||
Rule::in(config('core.notification_channels_providers')),
|
||||
Rule::in(array_keys(config('notification-channel.providers'))),
|
||||
],
|
||||
'name' => 'required',
|
||||
];
|
||||
|
Reference in New Issue
Block a user