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

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

curtissaunders/laravel-helpers
==============================

A series of helper functions for Laravel 5

v1.2.0(6y ago)6730↓100%1MITPHPPHP &gt;=5.5.9

Since Jan 17Pushed 6y ago3 watchersCompare

[ Source](https://github.com/CurtisSaunders/laravel-helpers)[ Packagist](https://packagist.org/packages/curtissaunders/laravel-helpers)[ RSS](/packages/curtissaunders-laravel-helpers/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

Laravel Helpers
===============

[](#laravel-helpers)

[![Latest Stable Version](https://camo.githubusercontent.com/73ff7f422e5353c47c1e295c666d752df32132e3f361b10718ae124a34ec4e5a/68747470733a2f2f706f7365722e707567782e6f72672f6375727469737361756e646572732f6c61726176656c2d68656c706572732f76657273696f6e)](https://packagist.org/packages/curtissaunders/laravel-helpers)[![Total Downloads](https://camo.githubusercontent.com/dcb0ee707b8bb86ffc0850e3d9e67f336e006e71478eece9b424e527cd5a1fa5/68747470733a2f2f706f7365722e707567782e6f72672f6375727469737361756e646572732f6c61726176656c2d68656c706572732f646f776e6c6f616473)](https://packagist.org/packages/curtissaunders/laravel-helpers)[![Latest Unstable Version](https://camo.githubusercontent.com/17779a2753d658312b1efba65a68c19fe11248baebf65179b603f6184af26c19/68747470733a2f2f706f7365722e707567782e6f72672f6375727469737361756e646572732f6c61726176656c2d68656c706572732f762f756e737461626c65)](https://packagist.org/packages/curtissaunders/laravel-helpers)[![License](https://camo.githubusercontent.com/b47654b7fe3733a833a072d1b8e5484ab22e882a9c2cce0916de56ce0b085f36/68747470733a2f2f706f7365722e707567782e6f72672f6375727469737361756e646572732f6c61726176656c2d68656c706572732f6c6963656e73652e737667)](https://packagist.org/packages/curtissaunders/laravel-helpers)

Installation
============

[](#installation)

This package requires PHP 5.6+, and includes a Laravel 5 Service Provider.

To install through composer include the package in your `composer.json`.

```
"curtissaunders/laravel-helpers": "^1.0"

```

Run `composer install` or `composer update` to download the dependencies or you can run `composer require curtissaunders/laravel-helpers`.

Laravel 5 Integration
---------------------

[](#laravel-5-integration)

To use the package with Laravel 5, add the Helper Service Provider to the list of service providers in `app/config/app.php`.

```
'providers' => [

  CurtisSaunders\LaravelHelpers\HelpersServiceProvider::class

];

```

Available helpers
-----------------

[](#available-helpers)

- [**versioned\_asset**](#versionedAsset) will apply a cache busting query string to your assets.
- [**concat**](#concat) will concatenate strings together
- [**concat\_ws**](#concat_ws) will concatenate strings together with the separator being defined as the first argument
- [**generate\_uuid**](#generate_uuid) will generate a valid RFC 4122 UUID
- [**route\_is/routeIs**](#route_is) will check if the current route matches the route passed
- [**query\_log\_to\_sql**](#query_log_to_sql) will allow you to log a database query to a variable and dump it out for easy debugging
- [**combine\_query**](#combine_query) will combine a query with its bindings

### ***Example of versioned\_asset:***

[](#example-of-versioned_asset)

`{{ versioned_asset('images/photo.png') }}`

outputs:

`http://mysite.com/images/photo.png?v=392104829`

### ***Example of concat:***

[](#example-of-concat)

`{{ concat('John', 'Terry', 'Dave') }}`

outputs:

`John Terry Dave`

### ***Example of concat\_ws:***

[](#example-of-concat_ws)

`{{ concat_ws(' - ', 'John', 'Terry', 'Dave') }}`

outputs:

`John - Terry - Dave`

***Example of generate\_uuid:***
-----------------------------------------------------------------------

[](#example-of-generate_uuid)

`{{ generate_uuid() }}`

outputs:

`e4eaaaf2-d142-11e1-b3e4-080027620cdd`

When using the `generate_uuid` function, you are able to generate valid RFC 1, 3, 4 and 5 versions. In order to change the version, simply pass the version number you require as the first argument (defaults to 1). For example, to generate a version 4 Uuid, you can do the following:

`{{ generate_uuid(4) }}`

outputs:

`25769c6c-d34d-4bfe-ba98-e0ee856f3e7a`

For versions 3 and 5, you are also required to pass in a string as the second argument. This is hashed and used when generating the Uuid. For example:

`{{ generate_uuid(3, 'php.net') }}`

outputs:

`11a38b9a-b3da-360f-9353-a5a725514269`

***Example of route\_is() or routeIs():***
----------------------------------------------------------------------------

[](#example-of-route_is-or-routeis)

*Examples shown in Laravel Blade*

```
@if(route_is('about.index'))
// Do something
@else
// Do something else
@endif

```

Alternatively

```
@if(routeIs('about.index'))
// Do something
@else
// Do something else
@endif

```

You can also check for specific parameters by passing them in an array as the second argument. For example, you may want to check that you're on a specific product category to apply an "active" class to a link. Consider the below when looping through category links:

```
@foreach($categories as $category)

        {{ $category->name }}

@endforeach

```

The above would apply a class of "active" when you're on the corresponding page to that link.

***Example of query\_log\_to\_sql:***
-------------------------------------------------------------------------------

[](#example-of-query_log_to_sql)

```
// Enable laravel's query log
DB::connection()->enableQueryLog();

... // Do database transactions ...

// Get all the queries ran since the query log was enabled
$queryLog = DB::getQueryLog();

// Combine the query logs ran with their bindings into the sql that was ran
$sqlQueries = query_log_to_sql($queryLog);

// Returns an array of all the sql queries ran with their bindings in place, useful for quick debugging
dd($sqlQueries);

```

***Example of combine\_query:***
-----------------------------------------------------------------------

[](#example-of-combine_query)

```
// Create a query using Eloquent
$eloquentQuery = UserModel::where('email', '=', 'user.name@example.com');

// Combine the Eloquent query sql and bindings into a query you can run in mysql
$sqlQuery = combine_query($eloquentQuery->toSql(), $eloquentQuery->getBindings());

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~81 days

Recently: every ~145 days

Total

14

Last Release

2351d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7bf072f94fec31a50130d566c06983cd366c00aa3099bc9a84a8f6458b886c0b?d=identicon)[CurtisSaunders](/maintainers/CurtisSaunders)

---

Top Contributors

[![midnite81](https://avatars.githubusercontent.com/u/254850?v=4)](https://github.com/midnite81 "midnite81 (6 commits)")[![CurtisSaunders](https://avatars.githubusercontent.com/u/25106606?v=4)](https://github.com/CurtisSaunders "CurtisSaunders (4 commits)")[![fullstackfool](https://avatars.githubusercontent.com/u/14146557?v=4)](https://github.com/fullstackfool "fullstackfool (4 commits)")

---

Tags

laravelhelpers

### Embed Badge

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

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

###  Alternatives

[pragmarx/ia-collection

Laravel Illuminate Agnostic Collection

473.4M2](/packages/pragmarx-ia-collection)[prologue/support

Prologue Support is an extension for Illuminate Support

1616.8k](/packages/prologue-support)

PHPackages © 2026

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