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. lajouizakariae/laravel-utils

ActiveLibrary

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

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

0.0.3(1mo ago)01↑2900%MITPHPPHP ^8.2

Since Mar 25Pushed 1mo 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 1mo 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

36

—

LowBetter than 82% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

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

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/746b26eae112aadde59aee99c72a008085b5bfb5145e270550e377df7e6661a4?d=identicon)[lajouiZakariae](/maintainers/lajouiZakariae)

---

Top Contributors

[![lajouiZakariae](https://avatars.githubusercontent.com/u/80148036?v=4)](https://github.com/lajouiZakariae "lajouiZakariae (14 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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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