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(); } }