Files
sam-api/app/Http/Requests/Admin/SendFcmRequest.php

38 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class SendFcmRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'title' => 'required|string|max:255',
'body' => 'required|string|max:1000',
'tenant_id' => 'nullable|integer|exists:tenants,id',
'user_id' => 'nullable|integer|exists:users,id',
'platform' => 'nullable|string|in:android,ios,web',
'channel_id' => 'nullable|string|max:50',
'type' => 'nullable|string|max:50',
'url' => 'nullable|string|max:500',
'sound_key' => 'nullable|string|max:50',
];
}
public function messages(): array
{
return [
'title.required' => __('validation.required', ['attribute' => '제목']),
'body.required' => __('validation.required', ['attribute' => '내용']),
'platform.in' => __('validation.in', ['attribute' => '플랫폼']),
];
}
}