first commit
This commit is contained in:
39
app/Http/Requests/PostStoreRequest.php
Executable file
39
app/Http/Requests/PostStoreRequest.php
Executable file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PostStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'translations'=>'required|array',
|
||||
'translations.*.title'=>'required|unique:post_translations',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'translations.*.title.required'=>'Поле обязательно для заполнения',
|
||||
'translations.*.title.unique'=>'Заголовок должен быть уникальным',
|
||||
];
|
||||
}
|
||||
}
|
30
app/Http/Requests/SliderRequest.php
Executable file
30
app/Http/Requests/SliderRequest.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SliderRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'image' => 'required|image|mimes:png,jpg,jpeg|max:10000',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user