PHP Package: spatie/laravel-fractal

Spatie's Laravel Fractal package integrates Fractal into Laravel for powerful API transformation capabilities.

Current Version: 6.3.2
Last Updated: 2025-02-14
PHP Requirement: ^8.0
Dependencies:
spatie/laravel
spatie/fractal
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

Laravel Fractal by Spatie is a robust library that seamlessly integrates Fractal's transformation features into Laravel applications. This package streamlines API responses, allowing for efficient data transformation and serialization. With Laravel Fractal, developers gain enhanced control over API output structure, making it ideal for building scalable and well-organized applications.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 6.3.2

Download Download v6.3.2

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/spatie/laravel-fractal/6.3.2/loader.php';
require_once 'libs/spatie/laravel/{lib_version}/loader.php';
require_once 'libs/spatie/fractal/{lib_version}/loader.php';

use Spatie\Fractal\Fractal;

$obj = new Fractal();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.