v1.0.0
Release Notes for Traitify v1.0.0
Release Date: 15th October 2024
We are excited to announce the first official release of Traitify (v1.0.0), a Laravel package that provides a set of reusable traits and contracts to streamline application development and enforce best practices.
New Features:
-
InteractsWithUuid Trait:
- Automatically generates UUIDs for models during creation.
- Supports custom UUID column names.
- Provides query scope for filtering models by UUID.
-
InteractsWithUser Trait:
- Automatically assigns the authenticated user ID to models during creation.
- Supports custom user ID column names.
- Works seamlessly with Laravel's
Auth
facade.
-
InteractsWithToken Trait:
- Automatically generates random 128-character tokens for models.
- Supports custom token column names.
- Provides query scope for filtering models by token.
-
InteractsWithSearchable Trait:
- Adds case-insensitive search functionality to models.
- Supports searching across single or multiple fields.
-
InteractsWithResourceRoute Trait:
- Helps in generating resource URLs (e.g.,
index
,show
) for models. - Automatically derives route base names from model names.
- Helps in generating resource URLs (e.g.,
-
InteractsWithMeta Trait:
- Manages meta fields dynamically in models.
- Automatically adds casts for the
meta
attribute as an array. - Supports default meta values.
-
InteractsWithEnum Trait:
- Provides methods to handle enum values, labels, and options with descriptions.
- Supports usage in select inputs for better UX.
-
InteractsWithDetails Trait:
- Allows models to define related details and apply eager loading.
- Provides a query scope to load related details efficiently.
-
InteractsWithApi Trait:
- Simplifies API response structure with methods for data, messages, and status codes.
- Supports customization of API responses.
Contracts:
-
Builder Contract:
- Defines a
build()
method that returns the instance of the class implementing it.
- Defines a
-
Execute Contract:
- Defines an
execute()
method that returns the instance of the class implementing it.
- Defines an
-
Menu Contract:
- Defines a
menus()
method that returns a collection of menu items.
- Defines a
-
Processor Contract:
- Defines a
process()
method that returns the instance of the class implementing it.
- Defines a
Improvements & Enhancements:
- Enhanced unit tests for each trait and contract, ensuring reliable functionality.
- Compatibility with Laravel's core features like UUIDs, meta fields, token management, and API responses.
- Designed to be modular, flexible, and easy to extend.
Installation:
You can install the package via Composer:
composer require cleaniquecoders/traitify
Documentation:
Full documentation and examples are available in the repository’s README.
Full Changelog: https://github.com/cleaniquecoders/traitify/commits/v1.0.0