From 4255d187c9f774b8cd35ede33c1d375cb36f5cfc Mon Sep 17 00:00:00 2001 From: AnhAnNek Date: Sat, 1 Aug 2026 22:54:56 +0700 Subject: [PATCH] fix --- app/Console/Commands/ResetCardsCommand.php | 6 +++--- app/Services/Admin/AdminService.php | 3 ++- config/logging.php | 2 +- resources/views/layouts/app.blade.php | 2 -- resources/views/user/change_password.blade.php | 12 ++++++++++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/Console/Commands/ResetCardsCommand.php b/app/Console/Commands/ResetCardsCommand.php index b8068e0..06a291a 100644 --- a/app/Console/Commands/ResetCardsCommand.php +++ b/app/Console/Commands/ResetCardsCommand.php @@ -4,6 +4,7 @@ namespace App\Console\Commands; use App\Services\Admin\Contracts\AdminServiceInterface; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class ResetCardsCommand extends Command { @@ -21,10 +22,9 @@ class ResetCardsCommand extends Command { try { $this->adminService->resetAllCards(); - $this->info('Successfully reset all cards for active members to 0!'); + Log::info('Successfully reset all cards for active members to 0!'); } catch (\Throwable $e) { - \Illuminate\Support\Facades\Log::error('Lỗi xảy ra khi chạy command reset thẻ hàng tháng (cards:reset): ' . $e->getMessage()); - $this->error('Reset cards failed: ' . $e->getMessage()); + Log::error('Error occurred while executing monthly card reset command (cards:reset): ' . $e->getMessage()); return Command::FAILURE; } diff --git a/app/Services/Admin/AdminService.php b/app/Services/Admin/AdminService.php index 4f38662..8fda677 100644 --- a/app/Services/Admin/AdminService.php +++ b/app/Services/Admin/AdminService.php @@ -11,6 +11,7 @@ use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; +use Illuminate\Support\Facades\Log; use App\DTOs\UserFilterDto; @@ -205,7 +206,7 @@ class AdminService implements AdminServiceInterface 'flag_send' => config('constants.FLAG_SEND_DISABLED'), ]); - \Illuminate\Support\Facades\Log::info("Thực hiện reset thẻ hàng tháng thành công cho {$activeUserCount} tài khoản active."); + Log::info("Monthly card reset executed successfully for {$activeUserCount} active accounts."); } public function updateAddCard(int $id, array $data): void diff --git a/config/logging.php b/config/logging.php index 4f4a77d..090f2fb 100644 --- a/config/logging.php +++ b/config/logging.php @@ -70,7 +70,7 @@ return [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), - 'days' => env('LOG_DAILY_DAYS', 14), + 'days' => env('LOG_DAILY_DAYS', 60), 'replace_placeholders' => true, 'permission' => 0666, ], diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index f3597a7..ae2d075 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -35,8 +35,6 @@
{{ session('error') }}
- @endif - @if($errors->any())
+ @if($errors->any()) +
+ @foreach($errors->all() as $error) +
+ + {{ $error }} +
+ @endforeach +
@endif - +
@@ -41,7 +50,6 @@
- @error('password'){{ $message }}@enderror