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

This package is auto-updated.

Last update: 2021-03-27 10:08:05 UTC


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`