32 lines
847 B
PHP
32 lines
847 B
PHP
<?php
|
||
|
||
namespace App\Filament\Resources\Channels\Pages;
|
||
|
||
use App\Actions\ConfigureChannel;
|
||
use App\Filament\Resources\Channels\ChannelResource;
|
||
use App\Models\Property;
|
||
use Filament\Resources\Pages\CreateRecord;
|
||
use Illuminate\Database\Eloquent\Model;
|
||
|
||
class CreateChannel extends CreateRecord
|
||
{
|
||
protected static string $resource = ChannelResource::class;
|
||
|
||
protected function handleRecordCreation(array $data): Model
|
||
{
|
||
$property = Property::query()->findOrFail($data['property_id']);
|
||
|
||
return app(ConfigureChannel::class)->handle($property, $data);
|
||
}
|
||
|
||
protected function getCreatedNotificationTitle(): ?string
|
||
{
|
||
return 'iCal-Verbindung angelegt – Exportlink automatisch erzeugt';
|
||
}
|
||
|
||
protected function getRedirectUrl(): string
|
||
{
|
||
return ChannelResource::getUrl('index');
|
||
}
|
||
}
|