Skip to content
Michael Lindahl edited this page Apr 12, 2018 · 10 revisions

Getting started

Package requires PHP 7.0+ (v5.5) / PHP 5.6.4+ (v5.3|5.4) / PHP 5.5.9+ (v5.1|5.2) / PHP 5.4+ (v0.4) and works with Laravel 5+.

  1. Require the package in your composer.json:

    # get all extensions
    composer require sofa/eloquence 
    
    # get single extension, eg. Metable
    composer require sofa/eloquence-metable
  2. Add Eloquence trait to the model - it's entry point for other extensions and is required for them to work.

  3. Add other traits, that you want to use.

  4. Laravel 5.4 & Below Add Sofa\Eloquence\BaseServiceProvider to your config/app.php providers array. With Laravel 5.5 and above the BaseServiceProvider is automatically registered. The BaseServiceProvider registers the Mutator as a service in the IoC Container as well as factories on the Builder class.

Clone this wiki locally