Files
usher-manage-stack/app/Http/Requests/StoreNoteRequest.php
gbanyan e8bef5bc06 feat(01-02): create MemberNoteController and routes
- MemberNoteController with index() and store() methods
- StoreNoteRequest with Traditional Chinese validation messages
- Routes registered at admin.members.notes.index/store
- JSON responses for AJAX consumption in Phase 2
- DB::transaction wrapper with AuditLogger::log
2026-02-13 12:09:09 +08:00

42 lines
1.0 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreNoteRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
// Authorization is handled by the admin middleware on the route group
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'content' => ['required', 'string', 'min:1', 'max:65535'],
];
}
/**
* Get custom messages for validator errors.
*/
public function messages(): array
{
return [
'content.required' => '備忘錄內容為必填欄位',
'content.min' => '備忘錄內容不可為空白',
'content.max' => '備忘錄內容不可超過 65535 字元',
];
}
}