Files
UNIT3D-Community-Edition/app/Http/Requests/StorePoll.php
HDVinnie 2ca429c4ce Revert "PSR12 Linting"
This reverts commit 7e65e1d589.
2022-09-11 19:51:58 -04:00

53 lines
1.2 KiB
PHP

<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* @see \Tests\Todo\Unit\Http\Requests\StorePollTest
*/
class StorePoll extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'title' => 'required|min:10',
'options.*' => 'filled',
'options' => 'min:2',
];
}
/**
* Get the error messages for the defined validation rules.
*/
public function messages(): array
{
return [
'options.*.filled' => 'You must fill in all options fields',
];
}
}