eventhomes/laravel-fractalhelper
Larablocks Analysis
eventhomes/laravel-fractalhelper works with Laravel 6 and 7 (latest release 2.0.1, Jan 28, 2020), all past end of life (the last on Sep 6, 2022): no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 6 and 7, past end of life since Sep 6, 2022
- No release in the last 12 months (last: Jan 28, 2020)
- 1 downloads a month (needs 10,000)
- 7 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jan 28, 2020.
- No releases in the last 12 months.
- First released: Jun 21, 2015.
- Monthly downloads: 1, down 80% from six months ago.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require eventhomes/laravel-fractalhelper |
|
| Latest Version: | 2.0.1 |
| PHP: | ^7.2 |
| Laravel: | 6 · 7 |
| License: | MIT |
| Last Updated: | Jan 28, 2020 |
| Links: | GitHub · Packagist |
Laravel 5 / Lumen 5 Fractal Api Controller
A simple api controller helper utilizing league fractal. You also get all the functionality provided by https://github.com/eventhomes/laravel-apicontroller
Installation
composer require eventhomes/laravel-fractalhelper
Basic Usage
By default, this helper will use ArraySerializer(), no setup required. You may, however, need to parse the GET includes.
...
use EventHomes\Api\FractalHelper;
class MyController extends Controller {
use FractalHelper;
public function __construct(Request $request)
{
$this->parseIncludes($request->get('includes', ''));
}
}
Customize Fractal
If you need to change the default ArraySerializer(), you can modify.
...
use EventHomes\Api\FractalHelper;
class MyController extends Controller {
use FractalHelper;
public function __construct(Manager $manager, Request $request)
{
$manager->setSerializer(new JsonApiSerializer);
$this->setFractal($manager)->parseIncludes($request->get('includes', ''));
}
}
Respond with item
public function show($id)
{
$user = User::find($id);
return $this->respondWithItem($user, new UserTransformer);
}
Respond with collection
public function index()
{
$users = User::all();
return $this->respondWithCollection($users, new UserTransformer);
}
Respond with collection, paginated
public function index()
{
$users = User::paginate(10);
return $this->respondWithCollection($users, new UserTransformer);
}
Related Packages
Simplified API controller, inspired by Jeffrey Way. Compatible with Laravel 5+ a...
Two simple tools for building REST APIs with fractal: console generator and API...
A Laravel Fractal package for building API responses, giving you the power of Fr...
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| 2.0.1 | ^7.2 | MIT | |
| 2.0.0 | ^7.2 | MIT | |
| v1.1.0 | ^7.2 | MIT | |
| v1.0 | ^7.2 | MIT | |
| v0.1.5 | ^7.2 | MIT | |
| v0.1.4 | >=5.5.9 | MIT | |
| 0.1.3 | >=5.5.9 | MIT | |
| 0.1.2 | >=5.5.9 | MIT | |
| 0.1.1 | >=5.5.9 | MIT | |
| 0.1.0 | >=5.5.9 | MIT |