authanram/laravel-flatfile
Composer 安装命令:
composer require authanram/laravel-flatfile
包简介
WORK IN PROGRESS
关键字:
README 文档
README
Eloquent flat file driver, on top of Sushi 🍣.
Requirements
PHP 8.1.4 or higher, Laravel 9+
Downward compatibility is already at the doorstep.
Installation
You can install the package via composer.
composer require authanram/laravel-flatfile
By default all files written by this package will be located at storage_path('app/flatfile').
Publish the package configuration:
php artisan vendor:publish --provider="Authanram\FlatFile\FlatFileServiceProvider"
Quickly examining the configuration file config/flatfile.php would be a good idea.
Usage Example
Here's an example of how it can be used in a very basic way:
namespace App\Models; use Authanram\FlatFile\FlatFileModel; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Post extends Model { use FlatFileModel; use SoftDeletes; protected $schema = [ 'title' => 'string', 'body' => 'string', 'published_at' => 'datetime', ]; protected $fillable = [ 'title', 'body', 'published_at', ]; }
Somewhere else in your code:
use App\Models\Post; Post::create([ 'title' => 'New package arrived: laravel-flatfile', 'body' => 'Solving the issue of...', 'published_at' => now()->addHour(), ])
This will store the following contents to storage_path('app/flatfile/post/1.json'):
{
"id": 1,
"title": "New package arrived: laravel-flatfile",
"body": "Solving the issue of...",
"published_at": "2022-06-26 11:29:27",
"created_at": "2022-06-26 10:29:27",
"updated_at": "2022-06-26 10:29:27",
"deleted_at": null
}
The package ships a second serializer, supporting yaml, that would lead to the following file
contents stored at storage_path('app/flatfile/post/1.yaml'):
id: 1 title: New package arrived: laravel-flatfile body: Solving the issue of... published_at: 2022-06-26 11:29:27 created_at: '2022-06-26 10:29:27' updated_at: '2022-06-26 10:29:27' deleted_at: null
Caveats
-
many-to-manyrelationships are currently not supportedIn order to facilitate a
many-to-manyrelationship, please fall back to a regular DBMS supported by Eloquent or feel free to create pull request.
Contributing
Please see the contribution guide for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Special thanks to Caleb Porzio, the author of the underlying package Sushi 🍣.
License
The MIT License (MIT). Please see License File for more information.
authanram/laravel-flatfile 适用场景与选型建议
authanram/laravel-flatfile 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 06 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「flatfile」 「authanram」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 authanram/laravel-flatfile 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 authanram/laravel-flatfile 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 authanram/laravel-flatfile 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Store and read configuration values using files on disk
Extension to Add and Save a flat file json
Modern Open Source Flat Files Content Management System.
Laravel Query Monitor
Document Store
A flat-file blog engine for PHP
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-27