Utils
in package
This is the LDCCRM utility class
Tags
Table of Contents
- $config : array<string|int, mixed>
- The env config
- $packageInfos : array<string|int, mixed>
- Package infos
- $translations : array<string|int, mixed>
- Loaded translations
- getConfig() : string|null
- Get config
- getPackageInfo() : array<string|int, mixed>
- Get composer.json infos
- getResquest() : Request
- Generate a Request from the route name
- log() : void
- Write log using syslog It also write log using \Illuminate\Support\Facades\Log if it is present
- makeValidator() : Validator
- Create a new Validator instance.
- translate() : string
- Translation a string using php file lang
Properties
$config
The env config
private
static array<string|int, mixed>
$config
$packageInfos
Package infos
private
static array<string|int, mixed>
$packageInfos
$translations
Loaded translations
private
static array<string|int, mixed>
$translations
= []
Methods
getConfig()
Get config
public
static getConfig(string $key[, string $default = null ]) : string|null
Parameters
- $key : string
- $default : string = null
Tags
Return values
string|null —getPackageInfo()
Get composer.json infos
public
static getPackageInfo() : array<string|int, mixed>
Return values
array<string|int, mixed> —getResquest()
Generate a Request from the route name
public
static getResquest(string $routeName[, array<string|int, mixed> $query = [] ][, array<string|int, mixed> $data = [] ]) : Request
Parameters
- $routeName : string
- $query : array<string|int, mixed> = []
-
params to pass on to the route
- $data : array<string|int, mixed> = []
-
http body params
Return values
Request —log()
Write log using syslog It also write log using \Illuminate\Support\Facades\Log if it is present
public
static log(string $message, LogLevel $level) : void
Parameters
- $message : string
-
The message is prefixed with "LDC CRM:"
- $level : LogLevel
-
The log level to apply
Return values
void —makeValidator()
Create a new Validator instance.
public
static makeValidator(array<string|int, mixed> $data, array<string|int, mixed> $rules) : Validator
Parameters
- $data : array<string|int, mixed>
- $rules : array<string|int, mixed>
Return values
Validator —translate()
Translation a string using php file lang
public
static translate(string $key[, string $lang = 'fr' ]) : string
Parameters
- $key : string
- $lang : string = 'fr'