PHPackages                             ethantechnology/php-helper - 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. ethantechnology/php-helper

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

ethantechnology/php-helper
==========================

A collection of useful PHP utility functions

00PHP

Since Apr 29Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Ethan Technology PHP Helper
===========================

[](#ethan-technology-php-helper)

A collection of useful PHP utility functions.

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

[](#installation)

You can install the package via Composer:

```
composer require ethantechnology/php-helper
```

Usage
-----

[](#usage)

### String Functions

[](#string-functions)

```
use Eta\Str;
// or
use Eta\Helper;

// Convert to snake_case
$snakeCase = Str::toSnakeCase('HelloWorld'); // Returns: hello_world

// Convert to camelCase
$camelCase = Str::toCamelCase('hello-world'); // Returns: helloWorld

// Check if string starts with
$startsWith = Str::startsWith('Hello World', 'Hello'); // Returns: true

// Check if string ends with
$endsWith = Str::endsWith('Hello World', 'World'); // Returns: true
```

### Random Generation Functions

[](#random-generation-functions)

```
use Eta\Str;
// or
use Eta\Helper;

// Generate random string with letters and numbers
$random = Str::random(10); // Returns: "aB3cD9fG2h"

// Alias for random()
$randomString = Str::randomString(10); // Returns: "aB3cD9fG2h"

// Generate random number string
$randomNumber = Str::randomNumber(10); // Returns: "1234567890"
```

### Laravel Specific Functions

[](#laravel-specific-functions)

```
use Eta\Laravel;
// or
use Eta\Helper;

// Get controller class name
$controller = Laravel::ctl('User'); // Returns: App\Http\Controllers\UserController

// Check token expiration
$isExpired = Laravel::checkTokenExpiration($user); // Returns: true/false

// Make model class name
$modelClass = Laravel::makeModelClassName('User', 'Eloquent'); // Returns: \App\Models\User\UserEloquent
```

### Utility Functions

[](#utility-functions)

```
use Eta\Str;
// or
use Eta\Helper;

// Check if value is valid JSON
$isJson = Str::isJson('{"key": "value"}'); // Returns: true
$isJson = Str::isJson('invalid json'); // Returns: false
```

Available Functions
-------------------

[](#available-functions)

### String Functions

[](#string-functions-1)

- `toSnakeCase(string $string): string` - Convert string to snake\_case
- `toCamelCase(string $string): string` - Convert string to camelCase
- `startsWith(string $haystack, string $needle): bool` - Check if string starts with
- `endsWith(string $haystack, string $needle): bool` - Check if string ends with

### Random Generation Functions

[](#random-generation-functions-1)

- `random(int $length = 16): string` - Generate random string with letters and numbers
- `randomString(int $length = 16): string` - Alias for random()
- `randomNumber(int $length = 16): string` - Generate random number string

### Laravel Functions

[](#laravel-functions)

- `ctl(string $key): string` - Get fully qualified controller class name
- `checkTokenExpiration($user): bool` - Check if user's token has expired
- `makeModelClassName(string $name, string $type = ''): string` - Make full model class name

### Utility Functions

[](#utility-functions-1)

- `isJson(mixed $value): bool` - Check if value is valid JSON

Using Helper Class
------------------

[](#using-helper-class)

You can also use the `Helper` class to access all functions:

```
use Eta\Helper;

// String functions
$snakeCase = Helper::toSnakeCase('HelloWorld');

// Random functions
$random = Helper::random(10);

// Laravel functions
$controller = Helper::ctl('User');

// Utility functions
$isJson = Helper::isJson('{"key": "value"}');
```

License
-------

[](#license)

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

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/04f8fba766d99a468a1a9cd2d2407a5411f332b9f19501267b17b48af0e84a4a?d=identicon)[eta-h](/maintainers/eta-h)

### Embed Badge

![Health badge](/badges/ethantechnology-php-helper/health.svg)

```
[![Health](https://phpackages.com/badges/ethantechnology-php-helper/health.svg)](https://phpackages.com/packages/ethantechnology-php-helper)
```

###  Alternatives

[guillaumeferron/post-content

A post content builder field for Laravel Nova.

224.0k](/packages/guillaumeferron-post-content)

PHPackages © 2026

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