Done
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
2026-07-04 23:09:00 +10:00
parent 0485b85a59
commit 439139a057
50 changed files with 2405 additions and 548 deletions
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests\Categories;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreCategoryRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'title' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:2000'],
'parent_id' => [
'nullable',
Rule::exists('categories', 'id')->where('user_id', $this->user()->id),
],
'feeds' => ['array'],
'feeds.*.url' => ['required', 'url', 'max:2048'],
'feeds.*.type' => ['required', Rule::in(['rss'])],
'feeds.*.paywall' => ['boolean'],
];
}
}
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests\Categories;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateCategoryRequest extends FormRequest
{
public function authorize(): bool
{
return $this->route('category')->user_id === $this->user()->id;
}
public function rules(): array
{
return [
'title' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:2000'],
'parent_id' => [
'nullable',
Rule::exists('categories', 'id')->where('user_id', $this->user()->id),
Rule::notIn([$this->route('category')->id]),
],
'feeds' => ['array'],
'feeds.*.url' => ['required', 'url', 'max:2048'],
'feeds.*.type' => ['required', Rule::in(['rss'])],
'feeds.*.paywall' => ['boolean'],
];
}
}