hitechnix/support

Flexible helper methods & traits for commonly used functionalities.

v7.0.0 2024-01-30 08:32 UTC

This package is not auto-updated.

Last update: 2024-05-03 04:32:31 UTC


README

A support package that provides flexible and reusable helper methods and traits for commonly used functionalities.

📦 Requirements

The package requires PHP 8.0+ and follows the FIG standard PSR-4 to ensure a high level of interoperability between shared PHP code and is fully unit-tested.

📋 Features

  • Easy register an event listener with the dispatcher.
  • Easy begin the process a mailable.
  • Easy to validate your application's incoming data.
  • Allowing you to subscribe and listen for various events that occur within your application easily.
  • And much more!

🔧 Installation

Install the package with the below command:

composer require hitechnix/support

📝 Usage

In this section, we'll show how you can make use of the available traits.

  • The EventTrait makes it easy to add dispatching abilities to your classes.
<?php

use Hitechnix\Support\Traits\EventTrait;

class FooRepository
{
    use EventTrait;

    public function foo()
    {
        $this->fireEvent('foo');
    }
}
  • The RepositoryTrait makes it easy to create new instances of a model and to retrieve or override the model during runtime.
use Hitechnix\Support\Traits\RepositoryTrait;

class FooRepository
{
    use RepositoryTrait;

    public function foo()
    {
        return $this->createModel();
    }
}

📨 Message

I hope you find this useful. If you have any questions, please create an issue.

🔐 Security

If you discover any security-related issues, please email support@hitechnix.com instead of using the issue tracker.

📖 License

This software is released under the BSD 3-Clause License. Please see the LICENSE file or https://opensource.hitechnix.com/LICENSE.txt for more information.

✨ Contributors

Thanks goes to these wonderful people (emoji key):

Son Tran Thanh
Son Tran Thanh

🔧 🚇 🚧 💻 📖 👀

This project follows the all-contributors specification. Contributions of any kind welcome!