Download the PHP package s-damian/laravel-man-pagination without Composer

On this page you can find all versions of the php package s-damian/laravel-man-pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-man-pagination

Laravel Pagination for Manual SELECT Queries

Tests Static analysis Total Downloads Latest Stable Version License

Laravel Manual Pagination - Laravel Man Pagination

Introduction - Laravel Man Pagination

This package is particularly useful for implementing pagination with manual SELECT queries using DB::select().

Laravel Man Pagination is an Open Source PHP library of a simple manual pagination (compatible with Bootstrap 5).

With this pagination, you will have no limits in a Laravel project to manage paginations.

This pagination also allows you to generate a per page form. This will generate a form HTML tag with a select HTML tag and clickable options.

Key Features

Basic Example

Paginate easily without limits 🚀

Author

This package is developed by Stephen Damian.

Requirements

Summary

Installation

Installation via Composer:

Customization With "vendor:publish"

Custom Config and Lang and CSS

After installing the package, you can run the vendor:publish command:

The vendor:publish command will generate these files:

You can of course customize these files.

"vendor:publish" With "--tag" Argument

Publish only config file:

Publish only lang files:

Publish only CSS file:

Pagination Instance Methods

Return type Method Description
void __construct(array $options = []) Constructor.
void paginate(int $total) (To use in the Controller) Activate the pagination.
null or int limit() (To use in the Controller) LIMIT: Number of items to retrieve.
null or int offset() (To use in the Controller) OFFSET: Starting point for the LIMIT.
int total() Determine the total number of matching items in the data store.
int count() Get the number of items for the current page.
int firstItem() Get the result number of the first item in the results.
int lastItem() Get the result number of the last item in the results.
int currentPage() Get the current page number.
int lastPage() Get the page number of the last available page (number of pages).
int perPage() The number of items to be shown per page.
bool hasPages() Determine if there are enough items to split into multiple pages.
bool hasMorePages() Determine if there are more items in the data store.
bool onFirstPage() Determine if the paginator is on the first page.
bool onLastPage() Determine if the paginator is on the last page.
bool onPage(int $pageNb) Determine if the paginator is on a given page number.
null or string previousPageUrl() Get the URL for the previous page.
null or string nextPageUrl() Get the URL for the next page.
string firstPageUrl() Get the URL for the first page.
string lastPageUrl() Get the URL for the last page.
string url(int $pageNb) Get the URL for a given page number.
string getPageName() Get the query string variable used to store the page.
string getPerPageName() Get the query string variable used to store the per page.
string links() (To use in the View) Make the rendering of the pagination in HTML format.
string perPageForm(array $options = []) (To use in the view) Make the rendering of the per page in HTML format.

Examples

Concrete Example With a Manual SELECT Query "DB::select"

When doing "complex" SQL queries, sometimes you prefer to do it without Eloquent.

Here is an example of an SQL query where this library is really useful:

Example rendering of pagination:

Laravel Man Pagination

Simple Example With a Manual SELECT Query "DB::select"

Here is a simple example, following the MVC pattern, of how to use this library:

Controller

View

Simple Example of Controller With Eloquent

This is for example only. Concretely, using Eloquent, you don't need this library. Because You can use Eloquent's paginate method.

Instance Options

Differences With Laravel Integrated Pagination

In this pagination, I tried to keep the conventions and the behavior of the pagination integrated in Laravel.

I Added Extra "Security":

If, for example, there are only 8 pages, and in the URL the visitor tries to go to page 9 (or to a page after page 9):

Support

If you discover a bug or a security vulnerability, please send a message to Stephen. Thank you.

All bugs and all security vulnerabilities will be promptly addressed.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


All versions of laravel-man-pagination with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package s-damian/laravel-man-pagination contains the following files

Loading the files please wait ....