36 lines
905 B
PHP
36 lines
905 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class StoreHomepageDescriptionRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return auth()->check();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'title' => 'required',
|
||
|
|
'text' => 'required',
|
||
|
|
'picture1' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=275,height=339',
|
||
|
|
'alt_text_picture1' => 'required|max:255',
|
||
|
|
'picture2' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=318,height=399',
|
||
|
|
'alt_text_picture2' => 'required|max:255',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|