gazsp/eloquent-cockpit
Composer 安装命令:
composer require gazsp/eloquent-cockpit
包简介
Use Laravel Eloquent and Cockpit together
README 文档
README
Use Cockpit and Laravel Eloquent, together at last. Uses jenssegers/laravel-mongodb.
MongoDB only at the moment
Installation
composer require jenssegers/mongodb
composer require gazsp/eloquent-cockpit
Lumen
Make sure Facades are enabled in app.php, and that the jenssegers/laravel-mongodb service provider is loaded:
$app->withFacades(); // ... $app->register('Jenssegers\Mongodb\MongodbServiceProvider');
Laravel
TBC (probably no different from Lumen)
Usage
If you have a collection called 'Events' in Cockpit, the model in Laravel or Lumen would be:
<?php namespace App\Repo\Collections; use Gazsp\EloquentCockpit\CockpitCollection; class Events extends CockpitCollection { protected $cockpitSlug = 'events'; }
You can then use the model as normal:
$events = Events::all(); // etc...
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-02