Download the PHP package andre1502/net_utilities without Composer
On this page you can find all versions of the php package andre1502/net_utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andre1502/net_utilities
More information about andre1502/net_utilities
Files in andre1502/net_utilities
Package net_utilities
Short Description Library to combine common function
License MIT
Informations about the package net_utilities
net_utilities
Library to help faster initialization Laravel project which include common functions, lang, exceptions, middleware, and routes.
Installation
Run this script from command line inside project folder
Package will do auto publish for Lang data, to publish package config you can run this script from command line inside project folder
Most of the config data can be overriden from project .env
.
Config value
JWT
To generate jwt key:
To generate jwt key and overwrite existing:
To display current jwt key:
Usage
Functions
Functions are added as Traits for easy to use (without needed to add dependency injection inside constructor).
Consists of:
- ConfigTrait
- UtilsTrait
- HttpRequestTrait
-
Commands Trait:
- PrependsEnvironmentTrait
- PrependsOutputTrait
- PrependsTimestampTrait
Commands Trait are useful to include inside Laravel Console Commands to make logging more richer.
You can use Traits directly inside Laravel class, e.g.:
Lang
Inside Laravel package also possible to include locales translation files which can be used inside package or Laravel project itself.
To access this translation:
Exceptions
Exceptions are used to write log and shape the error output to user. Better to also include Response from Symfony to use standard Http Status code.
Middleware
Package will automatically iclude common middleware which need to have,
- APICheckJWT
- APICheckAuthToken
- APIResponseFormat
- DashboardBasicAuth
APICheckJWT && RedisCheckJWT
This middleware are used to authenticate user JWT to centralized API, it will return user data.
Package will automatically register to middleware kernel as apiCheckJwt
and redisCheckJwt
.
You can use it inside route api
:
You also need to setup .env
file for this key:
APICheckAuthToken
This middleware are used to authenticate internal API call.
Package will automatically register to middleware kernel as apiCheckAuthToken
.
You can use it inside route api
:
APIResponseFormat
This middleware are used to custom format API response globaly.
Package will automatically register to middleware kernel group for api
.
DashboardBasicAuth
This middleware are used to create basic authentication to access package dashboard with authentication.
Package will automatically register to middleware kernel as dashboardBasicAuth
.
You also need to setup .env
file for this key:
or
Allowed IP also support more than one IP, you can separate it with comma, e.g.:
Routes
System will register common route for check whether project has been deployed correctly (health-check) and console route to help clean log remotely.
Package also automatically register the routes, so no additional action need to do.
All versions of net_utilities with dependencies
guzzlehttp/guzzle Version ^7.8.1
illuminate/support Version ^9|^10|^11
lcobucci/clock Version ^3.2
lcobucci/jwt Version ^4.3|^5.3
symfony/http-foundation Version ^6.3|^6.4|^7.0|^7.1