PHPackages                             permafrost-dev/laravel-helpers - 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. permafrost-dev/laravel-helpers

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

permafrost-dev/laravel-helpers
==============================

Useful helper functions and classes for Laravel

1.0.0(5y ago)12MITPHPPHP ^7.3CI failing

Since Jul 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/permafrost-dev/laravel-helpers)[ Packagist](https://packagist.org/packages/permafrost-dev/laravel-helpers)[ RSS](/packages/permafrost-dev-laravel-helpers/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (2)Used By (0)

Laravel Helpers
---------------

[](#laravel-helpers)

description

#### Installation

[](#installation)

You can install the package via composer:

```
composer require permafrost-dev/laravel-helpers
```

#### Helper Classes

[](#helper-classes)

- `\Permafrost\Helpers\ModelHelper`

Examples:

- *Retrieve the first 10 models, and cache the results for 30 seconds. Repeated calls within 30 seconds will return the cached results instead of performing a new database query.*

```
$models = ModelHelper::create(MyClass::class)
    ->cached(30)
    ->orderBy('id')
    ->latest()
    ->get();
```

- *Retrieve all MyClass record id values and cache them for 60 seconds. This can be used during database seeding to siginificantly speed up the process.*

```
// use the model helper class
$ids = ModelHelper::create(MyClass::class)
    ->cached(60)
    ->ids();

// or use a helper function
$ids = get_cached_model_ids(MyClass::class, 60);
```

---

- `Permafrost\Helpers\RouteHelper`

Examples:

Assuming a route defined as `/products/{category}/{id}` and named `web.products.show`, return `/products/books/123`:

```
    //class-based
    RouteHelper::routename('web.products.show/books/123');

    //helper function
    routename('web.products.show/books/123');
```

#### Helper Functions

[](#helper-functions)

```
    //get all ids for a model and cache the results; returns cached results if they exist
    function get_cached_model_ids(string $modelClass, int $ttlSeconds, int $recordLimit): array;

    //get all values of a column for a model and cache the results; returns cached results if they exist
    function get_cached_model_columns(string $modelClass, string $column, int $ttlSeconds, int $recordLimit): array;

    //get all values of a column for a model
    function get_model_column($modelClass, string $column, int $recordLimit): array;

    //get all ids for a model
    function get_model_ids($modelClass, int $recordLimit): array;

    //truncates text with an ellipsis, but doesn't return partially truncated words
    function str_tease(string $string, int $length, string $moreTextIndicator = '...'): string;

    //returns a relative url instead of a complete url
    function relative_route(string $name, array $parameters): string;

    //returns the value of a named route along with the provided parameters (see RouteHelper class)
    function routepath(string $routepath): string;

    //returns an array of the validated data
    function validate($fields, $rules);

    //returns true if the data passes validation
    function validated($fields, $rules);

    //creates a validator instance, accepting either array or string parameters
    function validator_create($fields, $rules);
```

#### Testing

[](#testing)

```
./vendor/bin/phpunit --testdox
```

License
-------

[](#license)

The MIT License (MIT). Please see the [LICENSE File](LICENSE) for more information.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de8dcb8e8a47ddc1076a26721d1ce7b17e3066b53c4a5c5e9aa31367c1955a20?d=identicon)[permafrost-dev](/maintainers/permafrost-dev)

---

Tags

helper-functionshelperslaravellaravel-helperslaravel-package

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/permafrost-dev-laravel-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/permafrost-dev-laravel-helpers/health.svg)](https://phpackages.com/packages/permafrost-dev-laravel-helpers)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M95](/packages/mongodb-laravel-mongodb)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M130](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k90.5k1](/packages/mike-bronner-laravel-model-caching)[spatie/laravel-settings

Store your application settings

1.5k7.3M150](/packages/spatie-laravel-settings)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M130](/packages/roots-acorn)

PHPackages © 2026

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