定制 nham24/macroable 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

nham24/macroable

最新稳定版本:0.1.1

Composer 安装命令:

composer require nham24/macroable

包简介

A set of useful Laravel macros

README 文档

README

This repository contains some useful macros and extensible Macroable trait.

Installation

You can pull in the package via composer:

composer require nham24/macroable

The package will automatically register itself.

Collections

paginate

Create a LengthAwarePaginator instance for the items in the collection.

collect($posts)->paginate(5);

This paginates the contents of $posts with 5 items per page. paginate accepts quite some options, head over to the Laravel docs for an in-depth guide.

paginate(int $perPage = 15, string $pageName = 'page', int $page = null, int $total = null, array $options = [])

Request

isApi

Check if the request is an API request.


$request = 

request()->isApi();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-14