PHP code example of ghabriel25 / laravel-pagination-view
1. Go to this page and download the library: Download ghabriel25/laravel-pagination-view library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ghabriel25 / laravel-pagination-view example snippets
namespace App\Providers;
use Ghabriel\PaginationView\PaginationView;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
// USE ONLY ONE OF THESE BASED ON YOUR CSS FRAMEWORK
// Fomantic UI (Semantic UI)
PaginationView::fomanticuiView();
// Bootstrap
PaginationView::bootstrapView();
// Bulma CSS
PaginationView::bulmaView();
// Cirrus UI
PaginationView::cirrusView();
// UIkit
PaginationView::uikitView();
}
}
use App\Models\User;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome', [
'users' => User::paginate(10)
// or 'users' => User::simplePaginate(10)
]);
});
namespace App\Providers;
use Ghabriel\PaginationView\PaginationView;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
// Fomantic UI (Semantic UI)
PaginationView::fomanticuiView(true);
// Bootstrap
PaginationView::bootstrapView(true);
// Bulma CSS
PaginationView::bulmaView(true);
// Cirrus UI
PaginationView::cirrusView(true);
// UIkit
PaginationView::uikitView(true);
}
}