ablunier/laravel-database
Composer 安装命令:
composer require ablunier/laravel-database
包简介
Laravel database utilities package. Repository, cache, abstraction layer.
README 文档
README
This package provides some utilities and patterns to work with Laravel databases
Note: This package is in active development and NOT ready for production.
Features
- Automatic default and extendable repository pattern.
- Cache system over repository pattern.
- Model abstraction layer.
Requirements
- PHP 5.5 or higher.
- Laravel 5.
Installation
Require this package with composer:
composer require ablunier/laravel-database
After updating composer, add the ServiceProvider and Facade (optional) to the app.php config file:
// config/app.php 'providers' => [ '...', Ablunier\Laravel\Database\Manager\ModelManagerServiceProvider::class, ]; 'aliases' => [ '...', 'ModelManager' => Ablunier\Laravel\Database\Manager\Facades\ModelManager::class, ];
Copy the package config to your local config with the publish command:
php artisan vendor:publish
Usage
Repository pattern
<?php namespace App\Http\Controllers; use ModelManager; use View; class ExampleController extends Controller { public function index() { $repo = ModelManager::getRepository('App\User'); $users = $repo->all(); View::make('users.index', [ 'users' => $users ]); } }
<?php namespace App\Http\Controllers; use Ablunier\Laravel\Database\Contracts\Manager\ModelManager; use View; class ExampleController extends Controller { protected $mm; public function __construct(ModelManager $mm) { $this->mm = $mm; } public function index() { $repo = $this->mm->getRepository('App\User'); $users = $repo->all(); View::make('users.index', [ 'users' => $users ]); } }
Cache
Abstraction layer
Documentation
Visit the wiki for more information.
License
This software is published under the MIT License
ablunier/laravel-database 适用场景与选型建议
ablunier/laravel-database 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.44k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 07 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「abstraction」 「cache」 「repository」 「laravel」 「eloquent」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ablunier/laravel-database 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ablunier/laravel-database 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ablunier/laravel-database 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
repository php library
Store your language lines in the database, yaml or other sources
Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
ADOdb is a PHP database abstraction layer library
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
统计信息
- 总下载量: 4.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 26
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-03