PHPackages                             usmanahmedmalik/inspiring-quran - 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. usmanahmedmalik/inspiring-quran

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

usmanahmedmalik/inspiring-quran
===============================

A modern Laravel package for displaying random Quranic Ayats - forever-proof with zero external dependencies

v1.1.0(6mo ago)015MITPHPPHP ^8.2

Since Jan 28Pushed 6mo agoCompare

[ Source](https://github.com/usmanahmedmalik/InspiringQuran)[ Packagist](https://packagist.org/packages/usmanahmedmalik/inspiring-quran)[ RSS](/packages/usmanahmedmalik-inspiring-quran/feed)WikiDiscussions master Synced 1w ago

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

Inspiring Quran
===============

[](#inspiring-quran)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d405cd807255477a1ed1363ee0b8f07d1fb494c23c4e60cec2d4393725e253ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75736d616e61686d65646d616c696b2f696e73706972696e672d717572616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/usmanahmedmalik/inspiring-quran)[![Total Downloads](https://camo.githubusercontent.com/e84653a27bc8fa47cc750c19198e6365524b0020e67bba9632dc77e99c8dd5b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75736d616e61686d65646d616c696b2f696e73706972696e672d717572616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/usmanahmedmalik/inspiring-quran)[![License](https://camo.githubusercontent.com/d4a0ffb77774ac527b62316c95212e99dd494e47c7bc45a08e019661703ff2fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f75736d616e61686d65646d616c696b2f696e73706972696e672d717572616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/usmanahmedmalik/inspiring-quran)

A modern, lightweight, and "forever-proof" Laravel package that displays random Quranic Ayats. Inspired by Laravel's `Illuminate\Foundation\Inspiring` class, this package brings uplifting verses from the Quran to your terminal and applications.

Why Inspiring Quran?
--------------------

[](#why-inspiring-quran)

- **Zero External Dependencies**: All Ayats are hardcoded - no API calls, no external services, no breaking changes
- **Forever-Proof**: Works offline and will never break due to API changes or service shutdowns
- **Modern**: Built for PHP 8.2+ and Laravel 10/11/12
- **Multi-Language Ready**: Extensible structure supports adding translations in any language
- **Lightweight**: Simple, focused, and efficient
- **Auto-Discovery**: No manual provider registration needed

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

[](#installation)

You can install the package via composer:

```
composer require usmanahmedmalik/inspiring-quran
```

The package will automatically register itself thanks to Laravel's auto-discovery feature.

Usage
-----

[](#usage)

### Artisan Command

[](#artisan-command)

Display a random inspiring Quranic Ayat in your terminal:

```
php artisan inspire:quran
```

Output example:

```
  ┌─────────────────────────────────────────────────────────────────────┐
  │ فَإِنَّ مَعَ ٱلْعُسْرِ يُسْرًا ۝ إِنَّ مَعَ ٱلْعُسْرِ يُسْرًا         │
  │                                                                     │
  │ For indeed, with hardship comes ease. Indeed, with hardship comes   │
  │ ease.                                                               │
  │                                                                     │
  │ — Surah Ash-Sharh (94:5-6)                                          │
  └─────────────────────────────────────────────────────────────────────┘

```

Specify a locale:

```
php artisan inspire:quran --locale=en
php artisan inspire:quran --locale=ur
php artisan inspire:quran --locale=fr
```

Get ayat from a specific theme:

```
# List all available themes
php artisan inspire:quran --list-themes

# Get ayat from a specific theme
php artisan inspire:quran --theme=hope
php artisan inspire:quran --theme=patience
php artisan inspire:quran --theme=gratitude

# Combine theme with locale
php artisan inspire:quran --theme=mercy --locale=ur
```

### Programmatic Usage

[](#programmatic-usage)

#### Static Method (Laravel Inspiring Pattern)

[](#static-method-laravel-inspiring-pattern)

```
use Usmanahmedmalik\InspiringQuran\InspiringQuran;

$ayat = InspiringQuran::quote();

echo $ayat['arabic'];
// فَإِنَّ مَعَ ٱلْعُسْرِ يُسْرًا ۝ إِنَّ مَعَ ٱلْعُسْرِ يُسْرًا

echo $ayat['translations']['en'];
// For indeed, with hardship comes ease...

echo $ayat['reference']['surah'];
// Ash-Sharh

echo $ayat['reference']['ayah'];
// 94:5-6
```

#### Instance Methods

[](#instance-methods)

```
use Usmanahmedmalik\InspiringQuran\InspiringQuran;

$inspiringQuran = new InspiringQuran();

// Get a random quote
$ayat = $inspiringQuran->getQuote('en');

// Get ayat by theme
$ayat = $inspiringQuran->byTheme('hope', 'en');

// Get all ayats from a theme
$hopeAyats = $inspiringQuran->getAllByTheme('hope');

// Get available themes
$themes = $inspiringQuran->getAvailableThemes();
// ['hope', 'mercy', 'patience', 'prayer', 'gratitude', ...]

// Get themes with descriptions
$themesWithDesc = $inspiringQuran->getThemesWithDescriptions();
// ['hope' => 'Verses about hope and ease in difficulty', ...]

// Get all available locales
$locales = $inspiringQuran->getAvailableLocales();
// ['en', 'nl', 'fr', 'tr', 'ur', 'de', 'es']

// Get total count of ayats
$count = $inspiringQuran->count();
// 75

// Get all ayats
$allAyats = $inspiringQuran->getAllAyats();
```

### Web Usage Examples

[](#web-usage-examples)

#### Display in Blade Template

[](#display-in-blade-template)

```
// In your controller
use Usmanahmedmalik\InspiringQuran\InspiringQuran;

public function index()
{
    $ayat = InspiringQuran::quote('en');
    return view('welcome', compact('ayat'));
}
```

```
{{-- In your blade view --}}

        {{ $ayat['arabic'] }}

        {{ $ayat['translations']['en'] }}

        — {{ $ayat['reference']['surah'] }} ({{ $ayat['reference']['ayah'] }})

```

#### API Endpoint

[](#api-endpoint)

```
// In routes/api.php
use Usmanahmedmalik\InspiringQuran\InspiringQuran;

Route::get('/ayat/random', function (Request $request) {
    $locale = $request->query('locale', 'en');
    $theme = $request->query('theme');

    try {
        $ayat = $theme
            ? InspiringQuran::byTheme($theme, $locale)
            : InspiringQuran::quote($locale);

        return response()->json($ayat);
    } catch (\InvalidArgumentException $e) {
        return response()->json(['error' => $e->getMessage()], 400);
    }
});

Route::get('/ayat/themes', function () {
    return response()->json([
        'themes' => InspiringQuran::getThemesWithDescriptions(),
        'locales' => (new InspiringQuran())->getAvailableLocales(),
    ]);
});
```

```
# API Usage examples
curl http://localhost/api/ayat/random
curl http://localhost/api/ayat/random?locale=ur
curl http://localhost/api/ayat/random?theme=hope
curl http://localhost/api/ayat/random?theme=patience&locale=fr
curl http://localhost/api/ayat/themes
```

#### Daily Ayat Widget

[](#daily-ayat-widget)

```
// In your AppServiceProvider or any controller
use Illuminate\Support\Facades\View;
use Usmanahmedmalik\InspiringQuran\InspiringQuran;

public function boot()
{
    View::composer('*', function ($view) {
        $view->with('dailyAyat', InspiringQuran::quote());
    });
}
```

```
{{-- Now available in all views --}}

    Daily Inspiration
    {{ $dailyAyat['translations']['en'] }}
    {{ $dailyAyat['reference']['surah'] }}

```

### Data Structure

[](#data-structure)

Each Ayat is returned in the following format:

```
[
    'arabic' => 'فَإِنَّ مَعَ ٱلْعُسْرِ يُسْرًا',
    'translations' => [
        'en' => 'For indeed, with hardship comes ease.',
        'ur' => 'بیشک تنگی کے ساتھ آسانی ہے',
        'fr' => 'Mais, avec la difficulté vient la facilité',
        'tr' => 'Çünkü zorlukla beraber kolaylık vardır',
        'de' => 'Doch wahrlich, mit der Erschwernis geht Erleichterung einher',
        'es' => 'Ciertamente junto a la dificultad hay facilidad',
        'nl' => 'Voorwaar, met moeite komt gemak',
    ],
    'reference' => [
        'surah' => 'Ash-Sharh',
        'ayah' => '94:5-6',
    ],
]
```

Features
--------

[](#features)

- **75+ Carefully Curated Ayats**: Uplifting verses selected for inspiration
- **7 Languages Supported**: English, Dutch, French, Turkish, Urdu, German, and Spanish
- **Thematic Collections**: Filter ayats by theme (hope, mercy, patience, gratitude, etc.)
- **Beautiful Terminal Output**: Colorful, formatted display in CLI
- **Web &amp; API Ready**: Easy integration in Blade views, APIs, and widgets
- **Arabic Text with Translations**: Proper Surah references included
- **PHP 8.2+ with Modern Type Hints**
- **Compatible with Laravel 10, 11, and 12**
- **Zero External Dependencies**: No API calls, works completely offline
- **Forever-Proof Architecture**: Will never break due to external service changes

Included Ayats
--------------

[](#included-ayats)

The package includes **75 verses** categorized into **13 themes**:

### Available Themes

[](#available-themes)

#### Enhanced Themes (10+ verses each)

[](#enhanced-themes-10-verses-each)

- **Patience** (14 verses) - Verses about patience and perseverance
- **Gratitude** (12 verses) - Verses about being thankful
- **Hope** (12 verses) - Verses about hope and ease in difficulty
- **Mercy** (12 verses) - Verses about Allah's mercy and forgiveness
- **Guidance** (12 verses) - Verses about guidance and direction

#### Standard Themes

[](#standard-themes)

- **Prayer** (2 verses) - Verses about prayer and worship
- **Peace** (2 verses) - Verses about peace and tranquility
- **Strength** (2 verses) - Verses about strength and resilience
- **Change** (1 verse) - Verses about change and improvement
- **Trust** (2 verses) - Verses about trust in Allah
- **Unity** (1 verse) - Verses about unity and brotherhood
- **Accountability** (2 verses) - Verses about accountability and judgment
- **Provision** (2 verses) - Verses about sustenance and provision

All verses are carefully selected for their uplifting and inspirational nature.

Future Roadmap
--------------

[](#future-roadmap)

- Add more Ayats (targeting 50+) ✅ **Done! Now includes 75 verses**
- Add filtering by theme/category ✅ **Done!**
- Add search functionality
- Mood-based ayat selection
- Time-based inspiration (morning/evening verses)
- Verse of the day feature
- Publish config file for customization

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

[](#contributing)

Contributions are welcome! Here's how you can help:

### Adding More Ayats

[](#adding-more-ayats)

1. Fork the repository
2. Edit `src/InspiringQuran.php`
3. Add your Ayat to the `$ayats` array following the existing structure:

```
[
    'arabic' => 'Arabic text here',
    'translations' => [
        'en' => 'English translation here',
    ],
    'reference' => [
        'surah' => 'Surah Name',
        'ayah' => 'X:Y',
    ],
],
```

4. Submit a pull request

### Adding New Translations

[](#adding-new-translations)

1. Add your translation to existing Ayats in the `translations` array
2. Use the appropriate locale code (e.g., 'ur' for Urdu, 'tr' for Turkish, 'ar' for Arabic)
3. Currently supported: English (en), Dutch (nl), French (fr), Turkish (tr), Urdu (ur), German (de), Spanish (es)
4. Submit a pull request

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

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

Credits
-------

[](#credits)

- [Usman Ahmed Malik](https://github.com/usmanahmedmalik)
- All contributors

Support
-------

[](#support)

If you discover any security related issues, please email  instead of using the issue tracker.

Acknowledgments
---------------

[](#acknowledgments)

- Inspired by Laravel's `Illuminate\Foundation\Inspiring` class
- All praise is due to Allah (SWT)
- Quran translations are for inspirational purposes only

---

**Note**: This package is meant for inspirational purposes. For detailed Islamic study, please refer to authentic Quran translations and tafsir (commentary) from qualified scholars.

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance66

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

202d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dbcad40004a7023dca06a5d6aaebc8164bf64ff7a38e46e06907207d07ee803?d=identicon)[usmanmalik.me](/maintainers/usmanmalik.me)

---

Top Contributors

[![usmanahmedmalik](https://avatars.githubusercontent.com/u/22715704?v=4)](https://github.com/usmanahmedmalik "usmanahmedmalik (5 commits)")

---

Tags

laravelartisanlaravel-packageislamicinspirationquranayat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/usmanahmedmalik-inspiring-quran/health.svg)

```
[![Health](https://phpackages.com/badges/usmanahmedmalik-inspiring-quran/health.svg)](https://phpackages.com/packages/usmanahmedmalik-inspiring-quran)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k212.4M1.5k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M323](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M229](/packages/laravel-mcp)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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