fivesqrd/atlas-laravel
Composer 安装命令:
composer require fivesqrd/atlas-laravel
包简介
A Laravel 5 service provider for including the Atlas library.
关键字:
README 文档
README
A Laravel service provider for the Atlas library
Install
composer require fivesqrd/atlas-laravel
Composer will automaticall register the provider and facade. If not:
In config/app.php register the Atlas Service Provider in the "providers" array:
'providers' => array(
// ...
Atlas\Laravel\ServiceProvider::class,
)
In config/app.php add the Atlas facade under "aliases":
'aliases' => array(
// ...
'Atlas' => Atlas\Laravel\AtlasFacade::class,
)
Config
The config should be automatically created from the composer install. If not, run php artisan vendor:publish
Atlas uses 'DB_DATABASE', 'DB_USERNAME' and 'DB_PASSWORD' values defined in the .env config file.
Usage
Atlas facade is now available can be instantiated throughout the application like this:
\Atlas::model(App\Model\User::class)
->isActive(true)
->query()
->fetch()->all();
$user = \Atlas::model(App\Model\User::class)->fetch(1);
\Atlas::save($user);
\Atlas::relation($user)->tickets()->fetch()->all();
More usage examples for the Atlas API are avilable on the Atlas repo: http://github.com/Five-Squared/Atlas
统计信息
- 总下载量: 1.2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-17