1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00

Add GoCardless webhook request validation rules

This commit is contained in:
Benjamin Beganović 2024-06-12 19:33:39 +02:00
parent 19ef27b5e5
commit b5495416f5

View File

@ -0,0 +1,34 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Http\Requests\GoCardless;
use Illuminate\Foundation\Http\FormRequest;
class WebhookRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'events' => ['required', 'array'],
'events.*.resource_type' => ['required', 'string'],
];
}
}