34 lines
751 B
PHP
34 lines
751 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateMomentRequest 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 [
|
|
'title' => 'required|max:255',
|
|
'subtitle' => 'sometimes|max:255',
|
|
'text' => 'required|max:2047',
|
|
'picture' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048',
|
|
'alt_text_picture' => 'sometimes|max:255',
|
|
];
|
|
}
|
|
}
|