2025-07-06 11:30:38 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
2025-07-07 02:48:46 +02:00
|
|
|
use App\Models\Feed;
|
2025-07-06 11:30:38 +02:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
|
|
class UpdateFeedRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-07 00:51:32 +02:00
|
|
|
/**
|
|
|
|
|
* @return array<string, string>
|
|
|
|
|
*/
|
2025-07-06 11:30:38 +02:00
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'name' => 'required|string|max:255',
|
2025-07-07 02:48:46 +02:00
|
|
|
'url' => 'required|url|unique:feeds,url,' . ($this->route('feed') instanceof Feed ? (string)$this->route('feed')->id : (string)$this->route('feed')),
|
2025-07-06 11:30:38 +02:00
|
|
|
'type' => 'required|in:website,rss',
|
|
|
|
|
'language_id' => 'required|exists:languages,id',
|
|
|
|
|
'description' => 'nullable|string',
|
|
|
|
|
'is_active' => 'boolean'
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|