The vesperabr/laravel-macros
package add a set of useful macros to your Laravel app.
You can install the package via composer:
$ composer require vesperabr/laravel-macros
The package will automatically register itself.
The Str::dot()
method converts the given string to dot notation. This is especially useful when you need to handle form input names.
use Illuminate\Support\Str;
Str::dot('users[email]'); // users.email
The Str::initials()
method return the initials from a given string. The first parameter is the string and the second is the character limit.
use Illuminate\Support\Str;
Str::initials('Brenda Astin Zaion', 3); // BAZ
$ composer test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.