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.3

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 1mo ago

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 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

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

2116d 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

[barryvdh/laravel-ide-helper

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

14.9k123.0M685](/packages/barryvdh-laravel-ide-helper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[glhd/special

1929.4k](/packages/glhd-special)

PHPackages © 2026

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