PHPackages                             lajouizakariae/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lajouizakariae/laravel-utils

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

lajouizakariae/laravel-utils
============================

Laravel package to publish different types of utils to laravel projects.

0.0.3(3mo ago)01↓90%MITPHPPHP ^8.2

Since Mar 25Pushed 2mo agoCompare

[ Source](https://github.com/lajouiZakariae/laravel-utils)[ Packagist](https://packagist.org/packages/lajouizakariae/laravel-utils)[ RSS](/packages/lajouizakariae-laravel-utils/feed)WikiDiscussions main Synced 3w ago

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

Laravel Utils
=============

[](#laravel-utils)

Provides a single Artisan command that copies all utils into your application.

---

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

[](#installation)

### 1. Require the package

[](#1-require-the-package)

Run:

```
composer require lajouizakariae/laravel-utils
```

The service provider is auto-discovered via `composer.json`'s `extra.laravel.providers`.

### 2. Run the install command for CMI integration

[](#2-run-the-install-command-for-cmi-integration)

```
php artisan utils:cmi-install
```

Use `--force` to overwrite files that already exist:

```
php artisan utils:cmi-install --force
```

---

What gets copied
----------------

[](#what-gets-copied)

StubDestination`app/Enums/CardBrandEnum.php``app/Enums/CardBrandEnum.php``app/Services/CmiService.php``app/Services/CmiService.php``app/Http/Controllers/CmiController.php``app/Http/Controllers/CmiController.php``config/cmi.php``config/cmi.php``app/Events/CmiCallbackReceived.php``app/Events/CmiCallbackReceived.php``app/Listeners/ProcessCmiPayment.php``app/Listeners/ProcessCmiPayment.php``app/ValueObject/CmiCallbackData.php``app/ValueObject/CmiCallbackData.php``app/ValueObject/CmiOrderData.php``app/ValueObject/CmiOrderData.php``resources/views/cmi/layout.blade.php``resources/views/cmi/layout.blade.php``resources/views/cmi/ok.blade.php``resources/views/cmi/ok.blade.php``resources/views/cmi/fail.blade.php``resources/views/cmi/fail.blade.php`The command also:

- Appends CMI environment variables to your `.env.example` automatically.
- Publishes the CMI migration via `php artisan vendor:publish --tag=cmi-migrations`.

---

Post-install steps
------------------

[](#post-install-steps)

### 1. Fill in `.env` variables

[](#1-fill-in-env-variables)

The install command appends the following block to your `.env.example`. Copy them to your `.env` and fill in the values:

```
CMI_CLIENT_ID=your_client_id
CMI_STORE_KEY=your_store_key
CMI_GATEWAY_URL=https://test-lanacash.cmi.co.ma/fim/est3dgate
CMI_OK_URL=https://your-domain.com/cmi/ok
CMI_FAIL_URL=https://your-domain.com/cmi/fail
CMI_CALLBACK_URL=https://your-domain.com/api/cmi/callback
CMI_SHOP_URL=https://your-domain.com
CMI_LANG=fr
```

### 2. Register the event listener in `AppServiceProvider`

[](#2-register-the-event-listener-in-appserviceprovider)

```
use App\Events\CmiCallbackReceived;
use App\Listeners\ProcessCmiPayment;
use Illuminate\Support\Facades\Event;

Event::listen(CmiCallbackReceived::class, ProcessCmiPayment::class);
```

### 3. Add routes

[](#3-add-routes)

```
// routes/api.php
Route::get('/cmi/pay', [CmiController::class, 'pay'])->middleware('auth:sanctum');
Route::post('/cmi/callback', [CmiController::class, 'handleCallback']);

// routes/web.php
Route::get('/cmi/ok',   [CmiController::class, 'handleOk']);
Route::get('/cmi/fail', [CmiController::class, 'handleFail']);
```

### 4. Run the migration

[](#4-run-the-migration)

```
php artisan migrate
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance85

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

3

Last Release

94d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80148036?v=4)[Zakariae Lajoui](/maintainers/lajouiZakariae)[@lajouiZakariae](https://github.com/lajouiZakariae)

---

Top Contributors

[![lajouiZakariae](https://avatars.githubusercontent.com/u/80148036?v=4)](https://github.com/lajouiZakariae "lajouiZakariae (24 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

721160.4k12](/packages/tallstackui-tallstackui)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

984.0k](/packages/zidbih-laravel-deadlock)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

19253.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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