mass6/laravel-die-dump-array

Helper function to die and dump Laravel collection to their array representation

1.0.2 2022-05-26 19:25 UTC

This package is auto-updated.

Last update: 2024-04-26 23:25:01 UTC


README

Latest Version on Packagist Total Downloads

Helper function to die and dump Laravel collection to their array representation. When you want to dump an Eloquent model, and only want the model's attributes, the dda function will call the toArray() method on the model, then die and dump. Works with any class that implements the toArray method.

Installation

You can install the package via composer:

composer require mass6/laravel-die-dump-array

Usage

$user = User::find(1);
dda($user);

// Example output:
[
  'name' => 'Luca Brasi',
  'email' => 'luca.b@corleone.it'
]

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email samcharmy@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate by Beyond Code.