Download the PHP package wendelladriel/laravel-hut without Composer
On this page you can find all versions of the php package wendelladriel/laravel-hut. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wendelladriel/laravel-hut
More information about wendelladriel/laravel-hut
Files in wendelladriel/laravel-hut
Package laravel-hut
Short Description A collection of Helpers and Utilities for your Laravel application
License MIT
Informations about the package laravel-hut
Laravel Hut 🛖
A collection of Helpers and Utilities for your Laravel application
Installation
Run your migrations since this package provides a migration for a table called change_logs
that will
be explained below.
Usage
This package provides a lot of classes that can be useful for a lot of projects created with Laravel. I created this package because I use a lot of these Helpers and Utilities in the projects I work on, so I hope it can be useful for someone out there as well.
Exceptions
This package provides the class WendellAdriel\LaravelHut\Exceptions\ApiHandler
that you can use
and/or extend. This class can be used if you're creating an API. It will render all the errors
in JSON format.
You can extend it in your App\Exceptions\Handler
:
The ApiHandler
can also send custom error messages using custom exceptions, you just need to implement
the WendellAdriel\LaravelHut\Exceptions\AppExceptionInterface
. Example:
When throwing this exception in the code the ApiHandler
will return a response with the given message
and HTTP code.
If you have your APP_DEBUG
set to true, it will also send debug information when throwing an error.
HTTP
API Controller
This package provides the class WendellAdriel\LaravelHut\Http\ApiController
that you can extend.
Instead of extending from Laravel base controller, extend this Controller to get access to these
methods:
Requests and DTOs
This package provides the class WendellAdriel\LaravelHut\Http\BaseRequest
that you can extend.
Instead of extending from Illuminate\Foundation\Http\FormRequest
. This class is used so you can
use the DTO pattern when sending data from your Controllers to other application layer like Services
or Repositories.
This package also provides the class WendellAdriel\LaravelHut\Support\DTOs\BaseDTO
that you can extend
to create your own DTOs.
This package also provides a Request + DTO for tables that have basic features
like pagination, search and sort that you can use and/or extend.
Check the classes: WendellAdriel\LaravelHut\Http\CommonTableRequest
and
WendellAdriel\LaravelHut\Support\DTOs\CommonTableDTO
.
This package also provides a Request + DTO for tables with the basic features above plus
date range filters that you can use and/or extend.
Check the classes: WendellAdriel\LaravelHut\Http\DateRangeRequestand
WendellAdriel\LaravelHut\Support\DTOs\DateRangeDTO`.
Models
This package provides the class WendellAdriel\LaravelHut\Models\BaseModel
that you can extend.
Instead of extending from Illuminate\Database\Eloquent\Model
. This can be used to track changes made
in the DB that will be logged in a table called change_logs. Check the class WendellAdriel\LaravelHut\Models\ChangeLog
and the trait WendellAdriel\LaravelHut\Models\Traits\LogChanges
.
This package also provides the trait WendellAdriel\LaravelHut\Models\Traits\HasUuid
that can be used to add
a UUID field in your models.
Support
Formatter
This package provides the class WendellAdriel\LaravelHut\Support\Formatter
that you can use to format data
like integers, floats, monetary values, dates and also provides some generic and useful constants to use in the
code to avoid using hardcoded strings.
Paginator
This package provides the class WendellAdriel\LaravelHut\Support\Paginator
that you can use to manually
paginate Collections.
SlackClient
This package provides the class WendellAdriel\LaravelHut\Support\SlackClient
that you can use to send notifications
to Slack. First you need to add the configuration below into your config/services
file and set the ENV values
needed in your .env
file:
After that you can already use the sendNotification
method:
Credits
- Wendell Adriel
- All Contributors
Contributing
All PRs are welcome.
For major changes, please open an issue first describing what you want to add/change.
All versions of laravel-hut with dependencies
ext-curl Version *