From d92366b1f4912f15888babb160306cfa5acb0454 Mon Sep 17 00:00:00 2001 From: Ranjan Date: Wed, 10 Apr 2024 11:40:07 +0545 Subject: [PATCH] employee setup --- Modules/Employee/app/Repositories/EmployeeRepository.php | 3 +-- Modules/Employee/resources/views/index.blade.php | 7 +++++++ app/Providers/AppServiceProvider.php | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Modules/Employee/app/Repositories/EmployeeRepository.php b/Modules/Employee/app/Repositories/EmployeeRepository.php index c457287..01b1bb4 100644 --- a/Modules/Employee/app/Repositories/EmployeeRepository.php +++ b/Modules/Employee/app/Repositories/EmployeeRepository.php @@ -8,7 +8,7 @@ class EmployeeRepository implements EmployeeInterface { public function findAll() { - return Employee::get(); + return Employee::paginate(20); } public function getEmployeeById($employeeId) @@ -23,7 +23,6 @@ class EmployeeRepository implements EmployeeInterface public function create($employeeDetails) { - // dd($employeeDetails); return Employee::create($employeeDetails); } diff --git a/Modules/Employee/resources/views/index.blade.php b/Modules/Employee/resources/views/index.blade.php index baa1a40..ecca651 100644 --- a/Modules/Employee/resources/views/index.blade.php +++ b/Modules/Employee/resources/views/index.blade.php @@ -100,6 +100,13 @@ @endforeach +
+
+ {{ $employees->links() }} +
+
+ + diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 452e6b6..75932e0 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Pagination\Paginator; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -20,5 +21,7 @@ class AppServiceProvider extends ServiceProvider public function boot(): void { // + + Paginator::useBootstrap(); } }