2017 © Pedro Peláez
 

library eloquent-package

Eloquent ORM integration from Laravel for Objective PHP

image

objective-php/eloquent-package

Eloquent ORM integration from Laravel for Objective PHP

  • Saturday, May 7, 2016
  • by gauthier
  • Repository
  • 5 Watchers
  • 0 Stars
  • 134 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Objective PHP / Eloquent Package

Project topic

This package add seamless integration for Eloquent ORM (native Laravel ORM)., (*1)

It mainly allows configuring a connection to the database and registering the capsule as global, which is enough for creating and using Eloquent's style models in the application., (*2)

How to make it work

Install the package

Use composer to import the package in your application:, (*3)

# cd to your project root, where is the composer.json file stored
composer require objective-php/eloquent-package dev-master 

Activate it

You have to plug the package Middleware to your application to activate it:, (*4)


use ObjectivePHP\Application\ApplicationInterface; use ObjectivePHP\EloquentPackage\EloquentPackage; class Application extends ApplicationInterface { public function init() { // ... // plug Eloquent package to any requests // // add some filter as extra plug() parameters to condition package actual activation $this->on('bootstrap')->plug(new EloquentPackage()); // ... } }

Configure it

In order to make Eloquent fully functional, you have to define a database connection. This configuration has to be done in the application configuration. When using Objective PHP starter kit, all you have to do is to create a config file in the app/config folder, name it whathever you want (but eloquent.php seems to be a decent name for this purpose :)) and then return a config array like the following:, (*5)

php return [ 'eloquent.driver' => 'mysql', 'eloquent.host' => '127.0.0.1', 'eloquent.username' => /* user name */, 'eloquent.password' => /* plain text password */, 'eloquent.database' => /* database name */ // 'eloquent.charset' => /* defaults to 'utf8' */, // 'eloquent.collation' => /* defaults to 'utf8_unicode_ci' */ ];, (*6)

The Versions

07/05 2016

dev-master

9999999-dev https://github.com/objective-php/eloquent-package

Eloquent ORM integration from Laravel for Objective PHP

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

eloquent illuminate objective php