webthatmatters / laravel-php-utils
A laravel package with common functions which are used across several projects
This package's canonical repository appears to be gone and the package has been frozen as a result.
1.2.3
2020-11-27 09:21 UTC
Requires
- php: ^7.2
- ext-json: *
- laravel/framework: ^6.0
- nesbot/carbon: ^2.0
Requires (Dev)
- mockery/mockery: ^1.2
- orchestra/testbench: 4
- phpunit/phpunit: ^8
README
A laravel package which includes common functions used across several projects
Installation
- Install package using
composer require webthatmatters/laravel-php-utils
- Import
WebThatMatters\LaravelUtils\<package name>
in your Laravel projects. - Enjoy!
<?php
use WebThatMatters\LaravelUtils\Traits\CarbonMixinTrait;
class MyFilterClass {
use CarbonMixinTrait;
...
}
Available Classes
Traits
- Queries\FiltersQueries
- Queries\PaginatesQueries
- Queries\SearchesQueries
- Queries\SortsQueries
- CarbonMixinTrait
- EncryptsAttributes
- JoinsRelations
- ListsModels
- MakesHttpRequests
- ReordersEntities
Utils
- Validation\Rules\EnumValue
- ArrayUtils
- DateUtils
- CsvReader
Enum
<?php namespace App\Domain\Enums; use WebThatMatters\LaravelUtils\Util\Enum; class JobStatus extends Enum { const TODO = 'todo'; const IN_PROGRESS = 'in_progress'; const IN_REVIEW = 'in_review'; const DONE = 'done'; }
Exceptions
- ExternalServiceException
- InvalidOperationException
Testing
To test this package you will need docker
Run tests by running ./tests-docker.sh
.
Use flag --full
the first time to:
- `build image`
- run `composer install`