sjdaws / vocal
Recursive functionality for Eloquent in Laravel 4 and 5
Installs: 15 199
Dependents: 1
Suggesters: 0
Security: 0
Stars: 44
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: >=5.4.0
- illuminate/database: >=4.0
- illuminate/hashing: >=4.0
- illuminate/support: >=4.0
Requires (Dev)
- orchestra/testbench: >=2.0
README
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: