Download the PHP package mmerlijn/laravel-helpers without Composer
On this page you can find all versions of the php package mmerlijn/laravel-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mmerlijn/laravel-helpers
More information about mmerlijn/laravel-helpers
Files in mmerlijn/laravel-helpers
Package laravel-helpers
Short Description Laravel helpers: casts and facades
License MIT
Informations about the package laravel-helpers
Laravel Helpers
Summary
Casts
- Phone Rules
Rules
- Bsn
- Requestnr
Facades
- Distance
Traits
- AddressModelTrait
- NameModelTrait
install
For flash message
add to app.js
add to the preferred layout.blade (bottom of body)
Flash usage
or
or
Casts
Phone
Setter will cast phone to only numbers string
Getter will cast phone to a readable format
Important!!
fill city field before phone fields for the use of kental
Example
Initials
Setter will strip all none alphabetic characters
Getter will split all letters with a dot
Example
Rules (validators)
BSN
Validates Dutch BSN
Example
Requestnr
validate requestnr
regex: '/^((ZD|ZP|CW){1}\d{8}|(PG){1}\d{9})$/i'
Facades
Distance
Calculate distance between to coordinates
usage
The get method accepts three params: unit, format,precision
Flash
Adds a flash message to the session flash
usage
The get method accepts three params: unit, format,precision
Traits
AddressModelTrait
Required database fields
city, street, building, postcode
installation
Add to your model
This will trigger an attribute setter and getter.
Usage
NameModelTrait
Required database fields
initials, lastname, prefix, own_lastname, own_prefix, sex
installation
Add to your model
This will trigger an attribute setter and getter.