aurorawebsoftware/flymodel
Composer 安装命令:
composer require aurorawebsoftware/flymodel
包简介
Laravel Models on the FLY !
README 文档
README
FlyModel is a Laravel package that empowers you to create and manage models dynamically, on the fly !.
It allows to define flexible and customizable models and model fields without needing to change the database schema.
This package streamlines your workflow by eliminating the need to define models explicitly in your codebase. Instead, you can generate and interact with models as needed, based on a unique "deck" identifier.
The package uses FlexyField Package as Dynamic Field Engine.
For More Info Visit: https://github.com/AuroraWebSoftware/FlexyField
🚀 Features
- Dynamic Model Creation: Instantiate models with a specified "deck" identifier without pre-defining them.
- Dynamic Fields : Define flexible and customizable fields on models without needing to change the database schema.
- Automatic Scoping: Models are automatically scoped according to the deck, ensuring data isolation.
- Seamless Integration: Works effortlessly with Laravel’s Eloquent ORM.
📦 Installation
To get started with FlyModel, follow these steps:
Install the Package
Add FlyModel to your project using Composer:
composer require aurorawebsoftware/flymodel
Run the Migration
Create the necessary database table for storing fly models:
php artisan migrate
📘 Usage
Creating and Using Fly Models
With FlyModel, you can dynamically create models and perform various operations. Here’s how:
Instantiate a Model with a Deck
$building = FlyModel::of('building');
Save the Model if not saved or created before
$building->save();
Perform Field Operations
$building->flexy->name = 'Headquarter Building' $building->flexy->address = 'Ali Pasha Ave. number 10'; $building->flexy->city = 'İstanbul'; $building->flexy->floor = 7; $building->flexy->area = 313; $building->flexy->active = true; $building->save();
Perform Eloquent Operations
$buildings = FlyModel::of('building')->all(); $istanbulBuildings = FlyModel::of('building') ->where('flexy_city', 'İstanbul') ->get(); $largeBuildings = FlyModel::of('building') ->where('flexy_area', '>' 500) ->orderBy('flexy_area') ->get(); $highBuildingsInIstanbul = FlyModel::of('building') ->where('flexy_floor', '>' 10) ->where('flexy_city', 'İstanbul') ->get();
🧪 Testing
FlyModel integrates with Laravel’s testing environment. Here’s an example of how to write tests for it:
💬 Contributing
We welcome contributions to improve FlyModel!
aurorawebsoftware/flymodel 适用场景与选型建议
aurorawebsoftware/flymodel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 503 次下载、GitHub Stars 达 12, 最近一次更新时间为 2024 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「AuroraWebSoftware」 「flymodel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aurorawebsoftware/flymodel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aurorawebsoftware/flymodel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aurorawebsoftware/flymodel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ArFlow is a Laravel package that allows you to implement workflow management for your Laravel Eloquent models.
Laravel Models are now Uber Flexy!
This is my package connective
This is my package acalendar
AIssue Package for Laravel
ASetting is a Laravel package that allows you to dynamically define your config definitions.
统计信息
- 总下载量: 503
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-09