willypuzzle / laravel-helpers
A General Laravel Helpers package.
1.0.2
2022-03-24 09:33 UTC
Requires
- php: >=7.0.0
- ext-json: *
- illuminate/database: >=5.4.0
- illuminate/support: >=5.4.0
- lodash-php/lodash-php: >=0.0.6
This package is auto-updated.
Last update: 2024-10-24 15:16:50 UTC
README
In order to setup:
- Install with composer: composer require willypuzzle/laravel-helpers
- add this to the providers array: Willypuzzle\Helpers\GeneralServiceProvider::class
This is a collection of helpers that could be useful in a laravel enviroment. The helpers are grouped in facades divided by namespaces.
-
Willypuzzle\Helpers\Facades\General\Database
- getIdsFromModelsArray(array $models): It get a array of eloquent models and give back a set of ids relative to the models in the array.
-
Willypuzzle\Helpers\Facades\General\Environment
- isProduction(), it says if the environment is production
- isTesting(), it says if the environment is testing
- isDevelop(), it says if the enviroments is develop
- is($develop, $testing, $production), it says if it belongs to any of that environment for example is(true, true, false) says it is develop or testing environment.
In order to test the enviroment it uses the following values of APP_ENV:
- Develop: 'local', '''dev', 'develop', 'developing'
- Testing: 'test'. 'testing, 'staging', 'stage'
- Production: Other any values