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
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
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.
michael-rubel/laravel-loop-functions 适用场景与选型建议
michael-rubel/laravel-loop-functions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.1k 次下载、GitHub Stars 达 18, 最近一次更新时间为 2022 年 02 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「michael-rubel」 「laravel-loop-functions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 michael-rubel/laravel-loop-functions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 michael-rubel/laravel-loop-functions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 michael-rubel/laravel-loop-functions 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This package provides DX tweaks for Service Container in Laravel.
This package provides polymorphic coupon functionality for your Laravel application.
This package is a collection of classes you can use to standardize data formats in your Laravel application. It uses the Service Container to easily extend or override the formatter classes.
It is an example template for Laravel packages. Fill or change it the way you like.
Laravel Pipeline with DB transaction support, events and additional methods.
Convert empty data of any type to null.
统计信息
- 总下载量: 15.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 12
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-16
