Skip to content

Releases: culturegr/presenter

Automatic Array/JSON Conversion for Presenters

09 Oct 05:38
Compare
Choose a tag to compare

This release significantly enhances the usability of the Presenter package:

  • Automatic array and JSON conversion: Presenters can now be directly passed to views or returned from routes without explicitly calling toArray() or toJson().
  • Array access support: Presenters implement ArrayAccess, allowing them to be used like arrays.
  • JSON serialization: Presenters now implement JsonSerializable for seamless JSON encoding.
  • Abstract toArray() method: Enforces proper implementation in child classes, ensuring consistent behavior.
  • Updated documentation: README now clearly explains the new automatic conversion features and provides usage examples.
  • Expanded test coverage: New tests added for array access and JSON serialization functionality.

These improvements streamline the use of Presenters in Laravel applications, particularly for view data preparation and API responses, reducing boilerplate code and potential errors.

Important Note for Existing Users: If you're currently calling toArray() explicitly when using Presenters (e.g., UserPresenter::make($user)->toArray()), please note that these calls will continue to work as before. However, they are no longer necessary in most contexts due to the new automatic conversion feature. You can safely remove these explicit calls if desired, which will make your code cleaner and more concise.

These changes maintain backward compatibility while offering new, more convenient ways to use Presenters in your Laravel applications.

Support Laravel 11

03 Oct 06:55
Compare
Choose a tag to compare
  • Add support for Laravel 11.x

Support Laravel 10

06 Sep 07:55
Compare
Choose a tag to compare
  • Drop support for PHP 8.0
  • Drop support for Laravel 8.x
  • Add support for PHP 8.2 and 8.3
  • Add support for Laravel 10.x

Support PHP 8.1 and Laravel 9

21 Jun 07:47
Compare
Choose a tag to compare
  • Add support for PHP 8.1
  • Drop support for PHP 7.x
  • Add support for Laravel 9.x
  • Fix a bug in whenLoaded method

Move tests from Codeship CI to GitHub Actions

04 Mar 07:59
Compare
Choose a tag to compare
1.0.4

Move tests from Codeship CI to GitHub Actions

Support Laravel 8

15 Sep 11:00
Compare
Choose a tag to compare
1.0.3

Support Laravel 8

Make paginator's meta information to be properly casted

03 Aug 10:41
Compare
Choose a tag to compare

Paginated collection's meta information such as current_page, last_page, from, to, total and per_page will be casted to integer.

Other minor changes: Add .idea directory to .gitignore

Support Laravel 7

06 Apr 11:06
Compare
Choose a tag to compare

Update composer.json file to support Laravel 7

Initial release

12 Nov 08:25
Compare
Choose a tag to compare
1.0.0

Initial commit