PHPackages                             vcoder7/ltools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vcoder7/ltools

ActiveLaravel-plugin[Utility &amp; Helpers](/categories/utility)

vcoder7/ltools
==============

Laravel helper tools

1.0.2(4mo ago)11.9kMITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Aug 11Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/vcoder7/ltools)[ Packagist](https://packagist.org/packages/vcoder7/ltools)[ RSS](/packages/vcoder7-ltools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (11)Used By (0)

lTools - Features
=================

[](#ltools---features)

**Laravel helper tools**

- [Cache clear command](#cache_clear_command)
- [Automatic `uuid` field value generation](#automatic_uuid_value_generation)
- [Str `initials` helper (macro)](#str_class_macros)
- [Changelog integration](#changelog_integration)

#### Installation

[](#installation)

```
composer require vcoder7/ltools

```

### [Clear application, route, config and view cache](#cache_clear_command)

[](#clear-application-route-config-and-view-cache)

```
php artisan ltools:cache-clear

```

### [Automatic `uuid` field value generation](#automatic_uuid_value_generation)

[](#automatic-uuid-field-value-generation)

1. Add to your migration `$table->uuid()->unique();`
2. Add to your model:

```
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Vcoder7\Ltools\Http\Traits\CreateUuidTrait;

class MyModel extends Model
{
    use HasFactory, CreateUuidTrait;
}

```

### [Str `initials` helper (macro)](#str_class_macros)

[](#str-initials-helper-macro)

The `Str::initials()` macro returns the uppercase initials of a given name string. It intelligently trims whitespace and handles multi-word names.

Usage:

```
use Illuminate\Support\Str;

Str::initials('John Peter Smith'); // Returns: "JPS"

```

### [Changelog integration](#changelog_integration)

[](#changelog-integration)

**Setup:**

Publish config:

```
php artisan vendor:publish --tag=ltools-config

```

Publish migrations:

```
php artisan vendor:publish --tag=ltools-migrations

```

**Enable changelogs for one model**, add to the model `Vcoder7\Ltools\Http\Traits\RecordChangesTrait`

Example:

```
