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

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

hooshid/laravel-helpers
=======================

generic laravel helper functions

v1.0.3(6y ago)06MITPHPPHP &gt;=7.0

Since Apr 19Pushed 6y agoCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

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

[](#laravel-helpers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bae2a6b32240fde8402157e45d13d556ae64bb9f544b9c8b7f4fa220a1130246/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686f6f736869642f6c61726176656c2d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hooshid/laravel-helpers)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/c9c5bb4844e3b58302496b0c791dc683bd6e6e3bfd0e43a483fda66703d66825/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686f6f736869642f6c61726176656c2d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hooshid/laravel-helpers)

This is a helpers package that provides some built in helpers, and also provides an Artisan generator to quickly create your own custom helpers.

Install
-------

[](#install)

Via Composer

```
$ composer require hooshid/laravel-helpers
```

Setup
-----

[](#setup)

Add the service provider to the providers array in `config/app.php`.

```
'providers' => [
    Hooshid\Helpers\HelperServiceProvider::class,
];
```

If you are using Laravel's automatic package discovery, you can skip this step.

Publishing
----------

[](#publishing)

You can publish everything at once

```
php artisan vendor:publish --provider="Hooshid\Helpers\HelperServiceProvider"
```

or you can publish groups individually.

```
php artisan vendor:publish --provider="Hooshid\Helpers\HelperServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

This package comes with some built in helpers that you can choose to use or not. By default all of these helpers are active for your application. To adjust which helpers are active and which are inactive, open `config/helpers.php` and find the `package_helpers` option. Add or Remove any helpers you wish to activate/inactive to this key. Check the source code to see what functions are included in each helper and what each does.

You can also create your own custom helpers for inclusion in your application. An Artisan generator helps you quickly make new helpers for your application.

```
php artisan make:helper MyHelper
```

Your custom helper will be placed in `app/Helpers`, unless you override the default directory in your configuration.

By default, the service provider uses the `glob` function to automatically require any PHP files in the 'Helpers' directory. If you prefer a mapper based approach, you may edit the `custom_helpers` in the configuration file, and include the file name of any helpers in your custom directory you wish to activate. Within the new helper, define your own custom functions that will be available throughout your application.

```
if (!function_exists('hello')) {

    /**
     * say hello
     *
     * @param string $name
     * @return string
     */
    function hello($name)
    {
        return 'Hello ' . $name . '!';
    }
}
```

Available functions
-------------------

[](#available-functions)

> New functions are always adding. Feel free to contribute.

### Formatter

[](#formatter)

#### `get_excerpt()`

[](#get_excerpt)

get excerpt of text:

```
get_excerpt($text, $maxChars = null, $suffix = '...', $br = true, $clean_html = true);
```

#### `format_bytes()`

[](#format_bytes)

Format bytes into kilobytes, megabytes, gigabytes or terabytes:

```
format_bytes($bytes, $precision = 2);
```

#### `clean_string()`

[](#clean_string)

remove html tags from input:

```
clean_string($value, $functions = null);
```

#### `phone()`

[](#phone)

phone formatter (iran mobile and home phone numbers):

```
phone($phone);
```

### Image

[](#image)

#### `image()`

[](#image-1)

provides default image if empty:

```
$image = image('/images/test.jpg');

// /images/test.jpg
```

#### `gravatar()`

[](#gravatar)

provides gravatar image (if your app use laravel auth, when run function with null value, function try to catch user email with auth()-&gt;user()-&gt;email):

```
$gravatar = gravatar('email@gmail.com');
```

### Strings

[](#strings)

#### `str_lower()`

[](#str_lower)

Convert string to lowercase, assuming it's using the `UTF-8` encoding:

```
$lower = str_lower('TeSt');

// test
```

#### `str_upper()`

[](#str_upper)

Convert string to uppercase, assuming it's using the `UTF-8` encoding:

```
$upper = str_upper('TeSt');

// TEST
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

2202d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f7893f496bc282cf40f1872e929ab2d8da6c39cd7b29ee2c7a5513bebff26f0?d=identicon)[hooshid](/maintainers/hooshid)

---

Top Contributors

[![arkamali](https://avatars.githubusercontent.com/u/17387297?v=4)](https://github.com/arkamali "arkamali (11 commits)")

---

Tags

laravelhelpershooshid

### Embed Badge

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

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

###  Alternatives

[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)
