add notifications logic and add support of both JWT and Sanctum
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Notifications;
|
||||
|
||||
use App\Http\Requests\ApiFormRequest;
|
||||
|
||||
class NotificationUpdateRequest extends ApiFormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['sometimes', 'required', 'string', 'max:150'],
|
||||
'message' => ['sometimes', 'required', 'string', 'max:5000'],
|
||||
'target_group' => ['sometimes', 'required', 'string', 'max:50'],
|
||||
'channels' => ['sometimes', 'required', 'array'],
|
||||
'channels.*' => ['string', 'in:in_app,email,sms'],
|
||||
'priority' => ['nullable', 'string', 'max:20'],
|
||||
'status' => ['nullable', 'string', 'max:20'],
|
||||
'action_url' => ['nullable', 'string', 'max:255'],
|
||||
'attachment_path' => ['nullable', 'string', 'max:255'],
|
||||
'scheduled_at' => ['nullable', 'date'],
|
||||
'expires_at' => ['nullable', 'date', 'after_or_equal:scheduled_at'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user