vesperabr/laravel-macros

A set of useful Laravel macros

Installs: 183

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/vesperabr/laravel-macros

1.0.2 2021-11-01 23:21 UTC

This package is auto-updated.

Last update: 2025-09-29 02:43:59 UTC


README

The vesperabr/laravel-macros package add a set of useful macros to your Laravel app.

Installation

You can install the package via composer:

$ composer require vesperabr/laravel-macros

The package will automatically register itself.

Str macros

Str::dot()

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

Str::initials()

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

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.