定制 michael-rubel/laravel-loop-functions 二次开发

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

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

michael-rubel/laravel-loop-functions

最新稳定版本:3.4.3

Composer 安装命令:

composer require michael-rubel/laravel-loop-functions

包简介

Collection of functions to loop over your data.

README 文档

README

Laravel Loop Functions

Laravel Loop Functions

Latest Version on Packagist Total Downloads Code Quality Code Coverage GitHub Tests Action Status PHPStan

The package provides the collection of methods to loop over your data.

The package requires PHP 8 or higher and Laravel 9 or higher.

#StandWithUkraine

SWUbanner

Installation

Install the package using composer:

composer require michael-rubel/laravel-loop-functions

Usage

use LoopFunctions;

Assign Eloquent model attributes to class properties:

$this->propertiesFrom($model);

Assign array key values to class properties:

$this->propertiesFrom($array);

If you want to use dynamic properties, adjust the dynamic_properties key in the config and add the following trait if your class is not already implementing the get/set magic methods:

use WithDynamicProperties;

Note: if you use the Livewire components, it already has similar definitions under the hood.

Dump class properties:

$this->dumpProperties();

Ignored property names

By default, the package ignores id and password properties to avoid conflicts in Livewire/auth components. You can customize the ignore list by editing the config.

php artisan vendor:publish --tag="loop-functions-config"

Logging

The functions don't throw an exception in case of failed assignment (e.g. type incompatibility) but log such an event. You can disable exception logging if you wish so in the config.

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固