From 365251abd952b50c0597c0a13765db65ac01769e Mon Sep 17 00:00:00 2001 From: anazaryan Date: Wed, 20 Nov 2024 14:10:03 +0400 Subject: [PATCH] smol fixes --- app/Http/Controllers/CompanyController.php | 6 +++++- resources/views/companies.blade.php | 2 +- resources/views/detail_new.blade.php | 2 +- resources/views/info_company_new.blade.php | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index 397ff69..158afda 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -28,9 +28,13 @@ class CompanyController extends Controller default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; } } + if (is_null($request->get('sort'))){ - $emps = $emps->paginate(4); + $emps = $emps->orderByDesc('created_at')->orderBy('id'); + + } + $emps = $emps->paginate(4); if ($request->ajax()) { if ($request->get('block') == '1') diff --git a/resources/views/companies.blade.php b/resources/views/companies.blade.php index 5db8895..4a62d0e 100644 --- a/resources/views/companies.blade.php +++ b/resources/views/companies.blade.php @@ -107,7 +107,7 @@ - +