ldc-legaulois/app/Http/Requests/SurveyAnswersRequest.php
2021-03-05 08:24:06 +01:00

33 lines
673 B
PHP

<?php
namespace App\Http\Requests;
use App\Models\SurveysAnswers;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class SurveyAnswersRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::guard('customer')->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'answers' => 'required|array',
'answers.*' => 'exists:surveys_answers,id',
];
}
}