Plugins base (#613)

* wip

* wip

* cleanup

* notification channels

* phpstan

* services

* remove server types

* refactoring

* refactoring
This commit is contained in:
Saeed Vaziry
2025-06-14 14:35:18 +02:00
committed by GitHub
parent adc0653d15
commit 131b828807
311 changed files with 3976 additions and 2660 deletions

View File

@ -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',
];