承接 mralgorithm/laravel-pagination 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mralgorithm/laravel-pagination

Composer 安装命令:

composer require mralgorithm/laravel-pagination

包简介

pagination for laravel

README 文档

README

paginaion for lists

paginate your content and navigate to each page by using this simple package

images

- darkmode

darkmode

- lightmode

lightmode

installation

to install this package run:

composer require mralgorithm/laravel-pagination

then run this command to publish required files:

php artisan vendor:publish --tag=mralgorithm-laravel-pagination

for the last step, add this css to your template file

<link href="{{ url('laravel-pagination/laravelPaginationStyle.css') }}" rel="stylesheet">

usage

in the controllers:

to get offset you can use this function

\Mralgorithm\LaravelPagination\Helper::offset($pid,$limit)

example

public function show($pid = 1)
    {
        $limit = 15;
        $Content = Posts::limit($limit)->offset(\Mralgorithm\LaravelPagination\Helper::offset($pid,$limit))->get();
        return view('test',[
            'Content' => $Content,
            'count' => Posts::count(),
            'pid' => $pid
        ]);
    }

in views

to paginate your list add this code to your views

$laravelPagination->pagination($count,$limit,$pid,url('/%s'))

example

{{ $laravelPagination->pagination(@$count,15,$pid,url('/%s')) }}
<body>
    <table>
        <thead>
            ...
        </thead>
        <tbody>
            @foreach ($Content as $C)
                ...
            @endforeach
        </tbody>
    </table>
    {{ $laravelPagination->pagination(@$count,15,$pid,url('/%s')) }}
</body>

Configuration

to config this package edit /config/laravelPagination.php

parameters

mode:

Dark/Light Mode

set light to get lightmode set dark to get darkmode

next

use this parameters to set next button text/icon

  1. for font-awesome
<i class="fa fa-arrow-right"></i>
  1. for google font icon:
<i class="material-icons-round">arrow_right</i>
  1. for simple text: next

  2. for multilang support

__('yourTranslationFile.next')

replace parameters according to your language files

previous

use this parameters to set previous button text/icon

  1. for font-awesome
<i class="fa fa-arrow-left"></i>
  1. for google font icon:
<i class="material-icons-round">arrow_left</i>
  1. for simple text: next

  2. for multilang support

__('yourTranslationFile.previous')

replace parameters according to your language files

Styling

to change styles edit public/laravel-pagination/laravelPaginationStyle.css

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-07