User 介面 只能看資料不能做修改 Role 介面移除 Branch介面 只能看資料不能做修改 Room 介面 可操控 包廂開關台 Sqgger API 可操控API Room 有操控異動記錄 machine_statuses 需做資料留存需留7 天 20250528
20 lines
547 B
PHP
20 lines
547 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Traits;
|
|
|
|
use Illuminate\Contracts\Validation\Validator;
|
|
use Illuminate\Http\Exceptions\HttpResponseException;
|
|
use Illuminate\Http\Response;
|
|
|
|
trait FailedValidationJsonResponse
|
|
{
|
|
protected function failedValidation(Validator $validator)
|
|
{
|
|
throw new HttpResponseException(response()->json([
|
|
'message' => 'Validation failed.',
|
|
'errors' => $validator->errors(),
|
|
'code' => 'ERROR',
|
|
'token' => ''
|
|
], Response::HTTP_UNPROCESSABLE_ENTITY));
|
|
}
|
|
} |