ldc-web/app/Http/Requests/Webhooks/GitlabRequest.php
Jérémy Munsch b16b4a2107
php cs fix
2022-06-15 13:09:00 +02:00

31 lines
658 B
PHP

<?php
namespace App\Http\Requests\Webhooks;
use Illuminate\Foundation\Http\FormRequest;
class GitlabRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return $this->header('X-Gitlab-Token') !== null &&
$this->header('X-Gitlab-Token') === config('webhooks.gitlab.token');
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'event_type' => 'required|in:merge_request'
];
}
}