sjdaws/vocal

Recursive functionality for Eloquent in Laravel 4 and 5

2.0.0 2015-02-16 11:36 UTC

README

Build Status License Latest Stable Version

Extended functionality for Eloquent in Laravel 4 and 5.

Some parts of Vocal are based on Ardent for Laravel 4 by Max Ehsan.

Copyright (c) 2014-2015 Scott Dawson.

Documentation

What is Vocal

Vocal makes working with nested relationships easier. This is especially helpful if you're displaying multiple models to a user at once, such as a user profile with an address book, and want them to be able to change their name and update their address in one go.

Installation

The first thing you need to do is add sjdaws/vocal as a requirement to composer.json:

{
    "require": {
        "sjdaws/vocal": "2.0.*"
    }
}

Update your packages with composer update and you're ready to go.

Getting Started

Vocal extends the Eloquent base class, so your models are still fully compatible with Eloquent. Vocal simply intercepts some methods such as validate and save before they're passed to Eloquent.

To create a new Vocal model, simply make your model class extend the Vocal base class:

use Sjdaws\Vocal\Vocal;

class User extends Vocal {}

There is no need to add any Facades or Service Providers.

Usage

Vocal provides several settings and methods: