2017 © Pedro Peláez
 

library eloquent-cockpit

Use Laravel Eloquent and Cockpit together

image

gazsp/eloquent-cockpit

Use Laravel Eloquent and Cockpit together

  • Tuesday, June 2, 2015
  • by gazsp
  • Repository
  • 2 Watchers
  • 7 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

gazsp/eloquent-cockpit

Use Cockpit and Laravel Eloquent, together at last. Uses jenssegers/laravel-mongodb., (*1)

MongoDB only at the moment, (*2)

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:, (*3)

$app->withFacades();
// ...
$app->register('Jenssegers\Mongodb\MongodbServiceProvider');

Laravel

TBC (probably no different from Lumen), (*4)

Usage

If you have a collection called 'Events' in Cockpit, the model in Laravel or Lumen would be:, (*5)

<?php namespace App\Repo\Collections;

    use Gazsp\EloquentCockpit\CockpitCollection;

    class Events extends CockpitCollection {
       protected $cockpitSlug = 'events';
    }

You can then use the model as normal:, (*6)

$events = Events::all();
// etc...

The Versions

02/06 2015

dev-master

9999999-dev

Use Laravel Eloquent and Cockpit together

  Sources   Download

MIT

The Requires