- AdminFcmController, AdminFcmService 추가 - FormRequest 검증 (AdminFcmSendRequest 등) - Swagger 문서 추가 (AdminFcmApi.php) - ApiKeyMiddleware: admin/fcm/* 화이트리스트 추가 - FCM 에러 메시지 i18n 추가
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?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' => '플랫폼']),
|
|
];
|
|
}
|
|
} |