PHP Package: spatie/macroable

Spatie's Macroable PHP library allows extending objects with additional methods for enhanced functionality and flexibility in applications.

Current Version: 2.0.0
Last Updated: 2021-03-26
PHP Requirement: ^8.0
Dependencies: None

Package Description

The Macroable library by Spatie provides a seamless way to augment PHP objects with custom methods, empowering developers to extend functionalities efficiently. With this tool, developers can enhance the flexibility and utility of their applications by dynamically adding methods to existing classes, enabling streamlined customization and improved code maintainability. Seamlessly integrating with existing projects, this library offers a powerful solution for developers seeking to optimize their workflows and boost productivity.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 2.0.0

Download Download v2.0.0

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/macroable/2.0.0/loader.php';
use Spatie\Macroable\Macroable;

$obj = new Macroable();
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.