ldc-doux/app/Http/Requests/StoreGammeRequest.php
2021-12-20 17:21:09 +01:00

37 lines
982 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreGammeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'parent_gamme_id' => 'required|exists:gammes,id',
'title' => 'required|max:255',
'text' => 'required|max:255',
'color' => 'sometimes',
'picture' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=575,height=375',
'alt_text_picture' => 'required|max:255',
'banner' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1169,height=243',
'alt_text_banner' => 'required|max:255',
];
}
}