|
|
|
@ -11,6 +11,7 @@ use Illuminate\Http\JsonResponse; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Support\Facades\Validator; |
|
|
|
use Illuminate\Validation\ValidationException; |
|
|
|
use Psr\SimpleCache\InvalidArgumentException; |
|
|
|
|
|
|
|
class TranslationController extends BaseController |
|
|
|
{ |
|
|
|
@ -136,7 +137,7 @@ class TranslationController extends BaseController |
|
|
|
$this->AdminTranslationService->updateModel($request->all(), $id); |
|
|
|
return $this->responseService->success( |
|
|
|
null, |
|
|
|
__('admin.save_succeeded') |
|
|
|
__('admin.update_succeeded') |
|
|
|
); |
|
|
|
} catch (ValidationException|CustomException $e) { |
|
|
|
throw $e; |
|
|
|
@ -172,4 +173,19 @@ class TranslationController extends BaseController |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return JsonResponse |
|
|
|
* @throws InvalidArgumentException |
|
|
|
*/ |
|
|
|
public function rule(): JsonResponse |
|
|
|
{ |
|
|
|
try { |
|
|
|
return $this->responseService->success($this->methodShow('translation')); |
|
|
|
} catch (Exception $e) { |
|
|
|
return $this->responseService->systemError( |
|
|
|
__('exception.get_data_failed') . ':' . $e->getMessage() |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|