PHPackages                             hatamiarash7/laravel-utils - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. hatamiarash7/laravel-utils

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hatamiarash7/laravel-utils
==========================

Useful functions for Laravel

v1.1(6y ago)317GPL-3.0PHPPHP ^7.0CI failing

Since Jun 12Pushed 2y agoCompare

[ Source](https://github.com/hatamiarash7/Laravel-Utils)[ Packagist](https://packagist.org/packages/hatamiarash7/laravel-utils)[ RSS](/packages/hatamiarash7-laravel-utils/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

Laravel-Utils
=============

[](#laravel-utils)

[![Packagist Version](https://camo.githubusercontent.com/c007b1581055ee5e5dfdf35434960dc6cb8675de52c990c89fe13a8957577f63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686174616d696172617368372f6c61726176656c2d7574696c732e737667)](https://camo.githubusercontent.com/c007b1581055ee5e5dfdf35434960dc6cb8675de52c990c89fe13a8957577f63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686174616d696172617368372f6c61726176656c2d7574696c732e737667) [![BCH compliance](https://camo.githubusercontent.com/7eeb937ff20037bcdf398b09ac9dfd3a91a158c9927674dadafb5c278eb7f1bc/68747470733a2f2f626574746572636f64656875622e636f6d2f656467652f62616467652f686174616d696172617368372f4c61726176656c2d5574696c733f6272616e63683d6d6173746572)](https://bettercodehub.com/)

Usefull function for laravel.

Install
-------

[](#install)

```
composer require hatamiarash7/laravel-utils dev-master # Latest version
composer require hatamiarash7/laravel-utils            # Stable version
```

Usage
-----

[](#usage)

There is a separate classes for each purpose. Arrays , Strings , … See example of each ones :

### String Functions

[](#string-functions)

```
use Hatamiarash7\Utils\StringUtils;

// Remove given words from a string. Pass them as array.
StringUtils::removeWords($words, $string);

// Return length of string. Normal or UTF-8.
StringUtils::len($string);

// Convert all characters to lowercase.
StringUtils::lowercase($string);

// Convert all characters to uppercase.
StringUtils::uppercase($string);

// Count the number of substring occurrences.
StringUtils::subCount($haystack, $needle);

// Summarize a string by limit. You can use end string for summarized string.
StringUtils::summarize($content, $max_characters = 100, $append = " ...")

// Convert English letters to Persian.
StringUtils::toPersian($expression)

// Convert numeral string to Persian price format.
StringUtils::toPersianPrice($expression)
```

### Array Functions

[](#array--functions)

```
use Hatamiarash7\Utils\ArrayUtils;

// Remove the duplicates from an array.
ArrayUtils::unique($array, $keepKeys = false);

// Check is key exists and return value.
ArrayUtils::key($key, $array, $returnValue = false);

// Check is value exists in the array and return key.
ArrayUtils::exists($value, array $array, $returnKey = false);

// Returns the first element in an array.
ArrayUtils::first(array $array);

// Returns the last element in an array.
ArrayUtils::last(array $array);

// Returns the first key in an array.
ArrayUtils::firstKey(array $array);

// Returns the last key in an array.
ArrayUtils::lastKey(array $array);

// Searches for a given value in an array of arrays, objects and scalar values.
ArrayUtils::search(array $array, $search);

// Add a prefix to each key of array.
ArrayUtils::addPrefix(array $array, $prefix);
```

### Variable Functions

[](#variable--functions)

```
use Hatamiarash7\Utils\VariableUtils;

// Smart convert string to int.
ArrayUtils::int($value);

// Return only digits chars of a string.
ArrayUtils::digits($value);
```

Tests
-----

[](#tests)

All tests written using [orchestral's testbench](https://github.com/orchestral/testbench)

Check and run them to get more information about functions.

Support
-------

[](#support)

[![ko-fi](https://camo.githubusercontent.com/1fedf764fa06114b797ee53e7506df10880abed6766f854202d758df1707969d/68747470733a2f2f7777772e6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/D1D1WGU9)

Contributing
------------

[](#contributing)

If you want to add new functions ( or even a new class ) :

1. Fork repository !
2. Create your feature branch : `git checkout -b my-new-functions`
3. Commit your changes : `git commit -am 'Add some functions'`
4. Push to the branch : `git push origin my-new-functions`
5. Submit a pull request :D

Issues
------

[](#issues)

Each project may have many problems. Contributing to the better development of this project by reporting them.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Total

2

Last Release

2511d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65e9d9c994557645dc5a264cbcd3c2880b2c3de3f56d8385099b33faae8f2b5e?d=identicon)[hatamiarash7](/maintainers/hatamiarash7)

---

Top Contributors

[![hatamiarash7](https://avatars.githubusercontent.com/u/16325641?v=4)](https://github.com/hatamiarash7 "hatamiarash7 (36 commits)")

---

Tags

laravellaravel-packagelibrarynumbernumberspersianphpphp-libraryutilitiesutilityutilsutils-libutils-librarymbstringhttpurlslugifyclicommand-linefilesystemhelperarraystringutilityhelpersimageserializeemailenvironmenttimerfiltercollectionenvdatesutilsslugsmisc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hatamiarash7-laravel-utils/health.svg)

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

###  Alternatives

[jbzoo/utils

Collection of PHP functions, mini classes and snippets for everyday developer's routine life.

8321.5M36](/packages/jbzoo-utils)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[akhan619/laravel-ses-tracking

A Laravel artisan based package to create the AWS (SES + SNS) infrastructure to receive email event notifications with Http/Https endpoint.

149.9k](/packages/akhan619-laravel-ses-tracking)[cse/helpers-session

The helpers allows you to easily manage session data. START, SET, GET DELETE, HAS method session - all this is available in this library.

102.6k3](/packages/cse-helpers-session)

PHPackages © 2026

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