12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
33
app/Http/Requests/Api/V1/StorePressReleaseImageRequest.php
Normal file
33
app/Http/Requests/Api/V1/StorePressReleaseImageRequest.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePressReleaseImageRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->tokenCan('press-release-images:write') === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'image' => ['required', 'image', 'mimes:jpg,jpeg,png,webp', 'max:8192'],
|
||||
'title' => ['nullable', 'string', 'max:120'],
|
||||
'description' => ['nullable', 'string', 'max:500'],
|
||||
'copyright' => ['nullable', 'string', 'max:255'],
|
||||
'is_preview' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Api/V1/StorePressReleaseRequest.php
Normal file
44
app/Http/Requests/Api/V1/StorePressReleaseRequest.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1;
|
||||
|
||||
use App\Enums\PressReleaseStatus;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StorePressReleaseRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->tokenCan('press-releases:write') === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'company_id' => ['required', 'integer', 'exists:companies,id'],
|
||||
'category_id' => ['required', 'integer', 'exists:categories,id'],
|
||||
'language' => ['required', 'string', 'size:2'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'text' => ['required', 'string'],
|
||||
'backlink_url' => ['nullable', 'url', 'max:255'],
|
||||
'keywords' => ['nullable', 'string', 'max:255'],
|
||||
'status' => ['nullable', Rule::in([
|
||||
PressReleaseStatus::Draft->value,
|
||||
PressReleaseStatus::Review->value,
|
||||
])],
|
||||
'teaser_begin' => ['nullable', 'integer', 'min:0'],
|
||||
'teaser_end' => ['nullable', 'integer', 'min:0'],
|
||||
'no_export' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
38
app/Http/Requests/Api/V1/SubscribeNewsletterRequest.php
Normal file
38
app/Http/Requests/Api/V1/SubscribeNewsletterRequest.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1;
|
||||
|
||||
use App\Enums\Portal;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class SubscribeNewsletterRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->tokenCan('newsletter:subscribe') === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'portal' => ['required', Rule::in([
|
||||
Portal::Presseecho->value,
|
||||
Portal::Businessportal24->value,
|
||||
])],
|
||||
'email' => ['required', 'email', 'max:190'],
|
||||
'salutation_key' => ['nullable', 'string', 'max:20'],
|
||||
'first_name' => ['nullable', 'string', 'max:80'],
|
||||
'last_name' => ['nullable', 'string', 'max:80'],
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Api/V1/UpdatePressReleaseRequest.php
Normal file
44
app/Http/Requests/Api/V1/UpdatePressReleaseRequest.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1;
|
||||
|
||||
use App\Enums\PressReleaseStatus;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdatePressReleaseRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->tokenCan('press-releases:write') === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'company_id' => ['sometimes', 'required', 'integer', 'exists:companies,id'],
|
||||
'category_id' => ['sometimes', 'required', 'integer', 'exists:categories,id'],
|
||||
'language' => ['sometimes', 'required', 'string', 'size:2'],
|
||||
'title' => ['sometimes', 'required', 'string', 'max:255'],
|
||||
'text' => ['sometimes', 'required', 'string'],
|
||||
'backlink_url' => ['nullable', 'url', 'max:255'],
|
||||
'keywords' => ['nullable', 'string', 'max:255'],
|
||||
'status' => ['sometimes', Rule::in([
|
||||
PressReleaseStatus::Draft->value,
|
||||
PressReleaseStatus::Review->value,
|
||||
])],
|
||||
'teaser_begin' => ['nullable', 'integer', 'min:0'],
|
||||
'teaser_end' => ['nullable', 'integer', 'min:0'],
|
||||
'no_export' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue