PHPackages                             geofftech/laravel-tools - 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. geofftech/laravel-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

geofftech/laravel-tools
=======================

2.2.1(10mo ago)13841MITPHP

Since Apr 1Pushed 6mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (14)Used By (1)

GeoffTech - Laravel Tools
=========================

[](#geofftech---laravel-tools)

Various useful features and functions

Agent Instructions
------------------

[](#agent-instructions)

This is a Laravel package providing utility traits and helper classes. When working with this package:

### Package Structure

[](#package-structure)

- **Traits**: Located in `src/Traits/` - reusable functionality for Laravel models
- **Helpers**: Located in `src/Helpers/` - utility classes for common operations
- **Controllers**: Located in `src/Controllers/` - base controller functionality
- **Config**: Package configuration in `config/tools.php`
- **Service Provider**: Main package registration in `src/ServiceProvider.php`

### Development Guidelines

[](#development-guidelines)

- Follow PSR-4 autoloading standards with namespace `GeoffTech\LaravelTools`
- Use Laravel conventions for naming and structure
- Include comprehensive docblocks for all public methods
- Write tests for new functionality
- Maintain backward compatibility when possible
- Use semantic versioning for releases

### Key Features

[](#key-features)

- **HasStorage Trait**: Automatic file cleanup for model storage fields
- **ArrayHelper**: Utility methods for array manipulation
- **HtmlHelper**: HTML content processing utilities

### Testing

[](#testing)

Run tests with: `composer test` or `./vendor/bin/phpunit`

### Code Style

[](#code-style)

Use Laravel Pint for code formatting: `./vendor/bin/pint`

HasStorage Trait
----------------

[](#hasstorage-trait)

- if a model has links to files in storage, this trait will ensure those files are removed when they are de-linked from the model.
- works with Soft Deletes.
- On update, removed any files no longer linked to the model.
- On delete, removes all linked files.

```
    use HasStorage;

    protected $storage = [
        'image',
        'banner',
        'content' => 'image',
        'content' => 'image,file',
        'content' => ['image', 'file'],
    ];
```

For `simple fields`

- just pass the field name

For `JSON fields`

- we will extract out all properties in the JSON that match the property names passed.
- this can be a comma delimited string, an array, or a function that returns an array.

This assumes the `public` disk. To set the disk

```
    protected $storage_disk = 'private';
```

or to set per field

```
    protected $storage_disk = [
        'content' => 'private'
        ];
```

ArrayHelper
-----------

[](#arrayhelper)

### toSnakeCase

[](#tosnakecase)

- convert each key to snake case version.
- maps overrides.

HtmlHelper
----------

[](#htmlhelper)

### hasText

[](#hastext)

- strips tags and white space to see if there is any text present.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance61

Regular maintenance activity

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Recently: every ~68 days

Total

13

Last Release

312d ago

Major Versions

1.0.6 → 2.0.02024-08-15

PHP version history (2 changes)1.0.0PHP ^8.2

2.1.1PHP \*

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b0d954edec5a17aa7fc4c71357660f60ea2af580999125bc121ea135d21ee7a?d=identicon)[geofftech](/maintainers/geofftech)

---

Top Contributors

[![geofftech](https://avatars.githubusercontent.com/u/390920?v=4)](https://github.com/geofftech "geofftech (26 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/geofftech-laravel-tools/health.svg)

```
[![Health](https://phpackages.com/badges/geofftech-laravel-tools/health.svg)](https://phpackages.com/packages/geofftech-laravel-tools)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
