This package was created in mind to be used internally. We will never provide backward compatibility for this package. This package probably have many bugs that we are not aware of, or we don't use this package in a way that you do. If you want to use this package, you should fork it and use your own version. Happy to get any feedback, or pull requests, but don't expect us to merge them (sorry!).
This package provides a set of tools to help you develop Laravel applications.
You can install the package via composer:
composer require kellton/laravel-tools
To start developing first you must install the dependencies:
docker run --rm -v $(pwd):/app composer install
To test the package you can run:
docker run --rm -v $(pwd):/app -w /app php:8.2-cli vendor/bin/phpunit
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
In PHP, we are still missing a way to define undefined variables. The Undefined class is a solution for that.
The Builder class is a wrapper around the Laravel's Eloquent Builder, it provides a set of methods to help you build complex queries.
The Command class is a wrapper around the Laravel's Command class, that allowing you to use Dependency Injection in your commands.
The Data feature is a extended version of Value object that can be used to represent a data structure.
This solution allows you to validate input data using Laravel's validation rules.
The Dependency feature allowing you Lazy Dependency Injection in your classes.
Standard way of using Dependency Injection in Laravel is to use the constructor to inject dependencies, but whenever a classes is created, all the dependencies are also resolved. This can be a problem when you have a lot of dependencies, and you don't need all of them in every case.
In this case we resolve dependencies only when they are first used.
The Action feature is a wrapper around the Laravel's Controller and Service classes, that allowing you to skip huge amount of boilerplate code.
The Initializer feature allows you to initialize your project with a set of predefined data.
Initializer needs to be impotent, so it can be run multiple times without any side effects. So you are able to add new data to the initializer without worrying about breaking existing data. As this is only mechanism to initialize data, you are responsible for keeping queries impotent.
The OpenApi documentation feature allows you to generate OpenApi documentation for your API.
The Read model feature allows you to create a read models for your application.
The Builder directory contains a set of commonly used traits and Eloquent Builders.
The Commands directory is a place for a commonly used commands.
The Data directory contains a set of commonly used data classes.
The Enums directory contains a set of commonly used enums.
The Exception directory contains a set of commonly used exceptions.
The Features directory contains a set of commonly used features. If you need to create a feature that is composed of multiple files you can create a directory with the same name as the feature and put all the files there.
The Helpers directory contains a set of commonly used helpers.
The Models directory contains a set of commonly used models.
The Rules directory contains a set of commonly used rules.