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

40 lines
888 B
PHP
Raw Normal View History

<?php
2022-03-15 16:27:41 +01:00
namespace App\Http\Requests\Bo;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreRangeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
2022-03-15 16:27:41 +01:00
return auth('web')->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'))
],
];
}
}