ldc-gen-game-web/app/Http/Requests/UpdateProductRequest.php
Jérémy Munsch 1af96897f3
- Squash migration
- Normalize Model names and sql tables
- PHPCS clean up
- Change analytics form + field
2022-01-11 12:46:10 +01:00

40 lines
928 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateProductRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|string|min:2|max:255',
'picture' => [
'image',
'mimes:jpeg,png,jpg',
'max:2048',
Rule::dimensions()
->maxWidth(config('theme.product_image_maxwidth'))
->maxHeight(config('theme.product_image_maxheight'))
],
'range_id' => 'exists:ranges,id'
];
}
}