ldc-volena/app/Http/Requests/Bo/JobVideos/StoreJobVideoRequest.php

50 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2023-11-24 17:56:48 +01:00
<?php
namespace App\Http\Requests\Bo\JobVideos;
use App\Traits\Requests\HasPicture;
use Illuminate\Foundation\Http\FormRequest;
class StoreJobVideoRequest extends FormRequest
{
use HasPicture;
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
return auth('backend')->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
2023-11-24 17:56:48 +01:00
*/
public function rules(): array
{
return [
'title' => 'required|string|between:3,255',
'place' => 'required|string|between:3,255',
'video_id' => 'required|string|regex:%([^"&?\/\s]{11})%i',
];
}
/**
* Get custom attributes for validator errors.
*
* @return array<string, string>
2023-11-24 17:56:48 +01:00
*/
public function attributes(): array
{
return [
2024-03-20 17:39:24 +01:00
'title' => trans('validation.attributes.title'),
'place' => trans('validation.custom.place'),
2023-11-24 17:56:48 +01:00
'video_id' => trans('validation.custom.video_id'),
];
}
}