ldc-gen-game-web/app/Http/Requests/Bo/Ranges/StoreRangeRequest.php

48 lines
926 B
PHP
Raw Normal View History

<?php
2023-08-22 13:38:38 +02:00
namespace App\Http\Requests\Bo\Ranges;
2023-08-22 13:38:38 +02:00
use App\Traits\Requests\HasPicture;
use Illuminate\Foundation\Http\FormRequest;
class StoreRangeRequest extends FormRequest
{
2023-08-22 13:38:38 +02:00
use HasPicture;
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return auth()->check();
}
2023-08-22 13:38:38 +02:00
/**
* Prepare the data for validation.
*
* @return void
*/
protected function prepareForValidation()
{
$this->mergePicture('picture');
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
2023-08-22 13:38:38 +02:00
$rules = [
'name' => 'required|string|min:2|max:255',
];
2023-08-22 13:38:38 +02:00
return \array_merge(
$rules,
$this->pictureRules('picture', 500, 500, 500, 500, false),
);
}
}