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

Abandoned → [lyhty/support](/?search=lyhty%2Fsupport)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

sirmathays/convenient-laravel-helpers
=====================================

Adds some very convenient helpers to your Laravel project

v2.3.1(4y ago)03.5k1MITPHPPHP &gt;=7.1.3

Since Jul 8Pushed 3y ago1 watchersCompare

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

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

 [![](https://camo.githubusercontent.com/21976c2d0c77b598b6c7c8ac4b4086c36902b179dbf0032e8c203b66b5e0b5ea/68747470733a2f2f6d617474692e73756f72616e69656d692e636f6d2f73746f726167652f666f727572322e706e67)](https://camo.githubusercontent.com/21976c2d0c77b598b6c7c8ac4b4086c36902b179dbf0032e8c203b66b5e0b5ea/68747470733a2f2f6d617474692e73756f72616e69656d692e636f6d2f73746f726167652f666f727572322e706e67)

 [ ![Total Downloads](https://camo.githubusercontent.com/5627d48fa99422a873a21e4a906d61f735932abc2fa762b9af96e020f3350d04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7369726d6174686179732f636f6e76656e69656e742d6c61726176656c2d68656c70657273) ](https://packagist.org/packages/sirmathays/convenient-laravel-helpers) [ ![Latest Stable Version](https://camo.githubusercontent.com/82529d3f2f4f4c40f998a6657600878b93a3ebdc7b0bc2fb187f67d0cf9674b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7369726d6174686179732f636f6e76656e69656e742d6c61726176656c2d68656c70657273) ](https://packagist.org/packages/sirmathays/convenient-laravel-helpers) [ ![License](https://camo.githubusercontent.com/519e2e45e6b43d4d3c2246b933561f8b3250be1527ad7c4e8118338c6879afc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7369726d6174686179732f636f6e76656e69656e742d6c61726176656c2d68656c70657273) ](https://packagist.org/packages/sirmathays/convenient-laravel-helpers)

Convenient Laravel Helpers
==========================

[](#convenient-laravel-helpers)

This package provides some additional, convenient helpers for you to use with your Laravel project.

Installation
------------

[](#installation)

Install the package with Composer:

```
composer require sirmathays/convenient-laravel-helpers

```

Features
--------

[](#features)

### Helpers

[](#helpers)

- `class_uses_trait($class, $trait, bool $recursive = true): bool`
    - Return boolean value whether the given class uses given trait.
- `array_depth(array $array)`
    - Return integer describing the max depth of the given array.
- `class_implements_interface($class, $interface): bool`
    - Return boolean value whether the given class implements given interface.
- `class_extends($class, $parent): bool`
    - Return boolean value whether the given class extends given parent class.
- `set_type($value, $type)`
    - Alias for 'settype' which allows non-variables as arguments.
- `trim_spaces(string $string): string`
    - Trim spaces from string.
- `not_null($var): bool`
    - !is\_null
- `get_bool($value): bool`
    - Get boolean value from given value. Accepts string true/false.
- `class_namespace(string $className): string`
    - Get namespace of given class.
- `___(array $keys, array $replace = [], array $numbers = [], string $locale = null, string $glue = ' '): string`
    - Translate given messages and glue them together.

### Discovery class

[](#discovery-class)

This is pretty much copied from `Illuminate\Foundation\Events\DiscoverEvents` from, just made more generic.

**Examples**

```
use SirMathays\Convenience\Discovery;

$all = Discovery::within('app\Models')->toArray();
// ["App\Models\User", "App\Models\BlogPost", "App\Models\Concerns\Taggable", "App\Models\Contracts\BlogWriter"]

$classes = Discovery::classesWithin('app\Models')->toArray();
// ["App\Models\User", "App\Models\BlogPost"]

$traits = Discovery::traitsWithin('app\Models')->toArray();
// ["App\Models\Concerns\Taggable"]

$interfaces = Discovery::interfacesWithin('app\Models')->toArray();
// ["App\Models\Contracts\BlogWriter"]

$usingClasses = Discovery::usesWithin('app\Models', 'App\Models\Concerns\Taggable')->toArray();
// ["App\Models\BlogPost"]

$implementingClasses = Discovery::implementsWithin('app\Models', 'App\Models\Contracts\BlogWriter')->toArray();
// ["App\Models\User"]

$extendingClasses = Discovery::extendsWithin('app\Models', 'Illuminate\Database\Eloquent\Model')->toArray();
// ["App\Models\User", "App\Models\BlogPost"]
```

License
-------

[](#license)

Convenient Laravel Helpers is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Recently: every ~0 days

Total

12

Last Release

1478d ago

Major Versions

v1.2.0 → v2.0.02020-07-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cd5d6f2caaea83278fd1552c5bdc1b30b4164890ba0801a718dc20efa93738c?d=identicon)[TruecapeDev](/maintainers/TruecapeDev)

---

Top Contributors

[![sirmathays](https://avatars.githubusercontent.com/u/37704147?v=4)](https://github.com/sirmathays "sirmathays (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.6k2](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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