Note: The
master
branch and>=1.0
releases are for Laravel 5. Use the0.x
branch and~0.9
releases for Laravel 4.
Include the package:
composer require "cviebrock/laravel-resources:~0.9"
Add service provider and facades to app/config.php
:
'providers' => [
'Cviebrock\LaravelResources\ServiceProvider',
],
'aliases' => [
'Resource' => 'Cviebrock\LaravelResources\Facades\Resource',
'ResourceGroup' => 'Cviebrock\LaravelResources\Facades\ResourceGroup',
]
Publish the configuration:
php artisan config:publish "cviebrock/laravel-resources"
Edit the configuration (if needed), then generate and run the migration:
php artisan resources:table
php artisan migrate
Update app/config/packages/cviebrock/laravel-resources/resources.php
with the array of keys/descriptor classes you need.
Then, run the initial import to load those values in to the database:
php artisan resources:import