PHPackages                             faizshukri/phpquran - 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. faizshukri/phpquran

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

faizshukri/phpquran
===================

Complete PHP Quran Resource

v2.0.1(2y ago)4740716[1 issues](https://github.com/faizshukri/phpquran/issues)MITPHPPHP &gt;=5.6.0CI failing

Since Jan 29Pushed 2y ago5 watchersCompare

[ Source](https://github.com/faizshukri/phpquran)[ Packagist](https://packagist.org/packages/faizshukri/phpquran)[ RSS](/packages/faizshukri-phpquran/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (6)Dependencies (2)Versions (31)Used By (0)

PHP Quran
=========

[](#php-quran)

PHP Quran was created and is maintained by [Faiz Shukri](https://github.com/faizshukri). This package allow developer to retrieve quran ayah and translation easily.

[![PHP Quran](https://camo.githubusercontent.com/855be5adb74d9c989f173114cdc3d28b99b7128b837e2fb1ab2a4998df9e510b/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f6569305965683931496d4879586664685a7334394759766e3964475f4e4e72496e4e41552d713737517a5143485563327276596e31796a3057484b425f42456f62553761786b392d3362444c3d77313230302d683530302d6e6f)](https://camo.githubusercontent.com/855be5adb74d9c989f173114cdc3d28b99b7128b837e2fb1ab2a4998df9e510b/68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f6569305965683931496d4879586664685a7334394759766e3964475f4e4e72496e4e41552d713737517a5143485563327276596e31796a3057484b425f42456f62553761786b392d3362444c3d77313230302d683530302d6e6f)

[![PHPUnit](https://github.com/faizshukri/phpquran/actions/workflows/php.yml/badge.svg)](https://github.com/faizshukri/phpquran/actions/workflows/php.yml)[![Total Downloads](https://camo.githubusercontent.com/58995eb5e798367c5936008e1476f97a85a28649f1d4096fa691c8c22aca3ad0/68747470733a2f2f706f7365722e707567782e6f72672f6661697a7368756b72692f706870717572616e2f642f746f74616c2e737667)](https://packagist.org/packages/faizshukri/phpquran)[![Latest Stable Version](https://camo.githubusercontent.com/6293e87f99cf9453c364b4a3669006631888120ea4675127f42653d985ce35cc/68747470733a2f2f706f7365722e707567782e6f72672f6661697a7368756b72692f706870717572616e2f762f737461626c652e737667)](https://packagist.org/packages/faizshukri/phpquran)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cf67d0e8acb93fb277c1f639b095f8486c6a80ce0fce2083fe358e15f7eae939/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6661697a7368756b72692f706870717572616e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/faizshukri/phpquran/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/1102bd02890e31dbbffbc1b6e462e468675510b098c3f36e992f39ac88827152/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6661697a7368756b72692f706870717572616e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/faizshukri/phpquran/?branch=master)[![License](https://camo.githubusercontent.com/2c80bca3088ec1bed59d4eb06fb4a7b477138cbc9b1a910590693a6d04508ecc/68747470733a2f2f706f7365722e707567782e6f72672f6661697a7368756b72692f706870717572616e2f6c6963656e73652e737667)](https://packagist.org/packages/faizshukri/phpquran)

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

[](#installation)

[PHP](https://php.net) 7+/8+ is required. (5.6 is supported in v1.x)

This project can be installed via \[Composer\]:

```
$ composer require faizshukri/phpquran
```

### Laravel Integration

[](#laravel-integration)

PHP Quran has optional support for [Laravel](https://laravel.com) and comes with a Service Provider and Facades for easy integration.

Laravel version starting 5.5+ can use Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

#### Laravel without auto-discovery

[](#laravel-without-auto-discovery)

Open your Laravel config file `config/app.php` and add the following lines.

In the `$providers` array add the service providers for this package.

```
FaizShukri\Quran\QuranServiceProvider::class
```

Add the facade of this package to the `$aliases` array.

```
'Quran' => FaizShukri\Quran\Facades\Quran::class
```

Now the Quran Class will be auto-loaded by Laravel.

#### Configuration

[](#configuration)

PHP Quran supports optional configuration for Laravel.

To get started, you'll need to publish the config.

```
$ php artisan vendor:publish --provider="FaizShukri\Quran\QuranServiceProvider"
```

This will create a `config/quran.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are several config options:

1. `storage_path`

    By default, the app will download and store quran files in `storage/app/quran` directory. You may change the value to your own. However the path will be reside under `storage/app` directory.
2. `translations`

    Specify translations that you want to make available for use. Make sure you add translation here before use in the code.
3. `limit`

    Default limits per query are `15 ayah` and `3 translations`.
4. `structure`

    Structure of the data. Default is `minimal` which remove all unnecessary parent. `fixed` will make structure more consistent.

### Console

[](#console)

PHP Quran also ship a binary file to be used in console. You can access directly from `vendor/bin/quran`, or if you want to access it from anywhere, you can install PHP Quran globally and put your composer global directory path to your working environment's `$PATH`.

```
$ composer global require faizshukri/phpquran
```

Usage
-----

[](#usage)

```
use FaizShukri\Quran\Quran;

$quran = new Quran();

$quran->get('1:3');
// ٱلرَّحْمَٰنِ ٱلرَّحِيمِ

$quran->get('1:2,4-6');
// [
//   2 => "ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ",
//   4 => "مَٰلِكِ يَوْمِ ٱلدِّينِ",
//   5 => "إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ",
//   6 => "ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ"
// ]

$quran->translation('en')->get('1:3');
// The Entirely Merciful, the Especially Merciful,

$quran->translation('ar,en')->get('1:3');
// [
//   "ar" => "ٱلرَّحْمَٰنِ ٱلرَّحِيمِ",
//   "en" => "The Entirely Merciful, the Especially Merciful,"
// ]

$quran->translation('ar,en')->get('1:2,3');
// [
//   "ar" => [
//     2 => "ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ",
//     3 => "ٱلرَّحْمَٰنِ ٱلرَّحِيمِ"
//   ],
//   "en" => [
//     2 => "[All] praise is [due] to Allah, Lord of the worlds -",
//     3 => "The Entirely Merciful, the Especially Merciful,"
//   ]
// ]
```

### Console

[](#console-1)

PHP Quran can be used in console like this.

```
$ quran surah
# +------------------+-------------------+--------------------+-------------------+
# | All surah                                                                     |
# +------------------+-------------------+--------------------+-------------------+
# | 1. Al-Faatiha    | 30. Ar-Room       | 59. Al-Hashr       | 87. Al-A'laa      |
# | 2. Al-Baqara     | 31. Luqman        | 60. Al-Mumtahana   | 88. Al-Ghaashiya  |
# | 3. Aal-i-Imraan  | 32. As-Sajda      | 61. As-Saff        | 89. Al-Fajr       |
# ....

$ quran surah 1
#  =========== =============
#   Surah Al-Faatiha
#  =========== =============
#   Index       1
#   Name        Al-Faatiha
#   Name (ar)   الفاتحة
#   Meaning     The Opening
#   No. Ayah    7
#   Start       0
#   Type        Meccan
#   Order       5
#   Rukus       1
#  =========== =============

$ quran surah 1 2
# ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

$ quran surah 1 2,4-5 en
# [ 2 ]	[All] praise is [due] to Allah, Lord of the worlds -
# [ 4 ]	Sovereign of the Day of Recompense.
# [ 5 ]	It is You we worship and You we ask for help.

$ quran surah 1 2 ar,en
# [ AR ]	ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ
# [ EN ]	[All] praise is [due] to Allah, Lord of the worlds -

$ quran surah 1 2-4 ar,en
#
# AR
# ====
#
# [ 2 ]	ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ
# [ 3 ]	ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
# [ 4 ]	مَٰلِكِ يَوْمِ ٱلدِّينِ
#
#
# EN
# ====
#
# [ 2 ]	[All] praise is [due] to Allah, Lord of the worlds -
# [ 3 ]	The Entirely Merciful, the Especially Merciful,
# [ 4 ]	Sovereign of the Day of Recompense.
```

#### Surah name

[](#surah-name)

You can also specify surah by its name. If the surah specified cannot found, it will find the closest one first and will suggest to you if more than a surah is found.

```
$ quran surah baqara
#  =========== ===========
#   Surah Al-Baqara
#  =========== ===========
#   Index       2
#   Name        Al-Baqara
#   Name (ar)   البقرة
#   Meaning     The Cow
#   No. Ayah    286
#   Start       7
#   Type        Medinan
#   Order       87
#   Rukus       40
#  =========== ===========

$ quran surah nas 4
# No surah found. Did you mean one of the following?
#   [0] Yunus
#   [1] Abasa
#   [2] An-Nasr
#   [3] An-Naas
#  > 3

مِن شَرِّ ٱلْوَسْوَاسِ ٱلْخَنَّاسِ
```

#### Translation

[](#translation)

Translation can also be configured via console. It will be saved in the configuration file. (run `quran config:path` to see where the file is located).

```
$ quran translation:add ms.basmeih
# Downloading translation ms.basmeih ...
# ms.basmeih has been added successfully.

$ quran translation:add
# Please specify a translation ID. You can refer to the table below.
#
# +------------+----------+---------------+--------------------+
# | ID         | Language | Name          | Translator         |
# +------------+----------+---------------+--------------------+
# | sq.nahi    | Albanian | Efendi Nahi   | Hasan Efendi Nahi  |
# | sq.mehdiu  | Albanian | Feti Mehdiu   | Feti Mehdiu        |
# | sq.ahmeti  | Albanian | Sherif Ahmeti | Sherif Ahmeti      |
# | ber.mensur | Amazigh  | At Mensur     | Ramdane At Mansour |
# |                                                            |
# | .... 113 more translations                                 |
# +------------+----------+---------------+--------------------+

$ quran translation:list
# Currently configured translations.
#   - en.sahih
#   - ms.basmeih
```

Contributers
------------

[](#contributers)

Thanks to the following people and organization for helping out this project;

NameLink[![Tanzil](https://camo.githubusercontent.com/6cc50506241f18e283f66656f1b631f151d05cbdbd9a00cc6200f81334860847/687474703a2f2f74616e7a696c2e6e65742f7075622f7370726561642f62616e6e65722f74616e7a696c2e706e67)](https://camo.githubusercontent.com/6cc50506241f18e283f66656f1b631f151d05cbdbd9a00cc6200f81334860847/687474703a2f2f74616e7a696c2e6e65742f7075622f7370726561642f62616e6e65722f74616e7a696c2e706e67)[Tanzil.Net](http://tanzil.net)Hussaini Zulkifli[@hussaini](https://github.com/hussaini)License
-------

[](#license)

The PHP Quran code is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~102 days

Recently: every ~313 days

Total

30

Last Release

839d ago

Major Versions

v0.5.1 → 1.0.0-beta2020-10-07

v1.0.2 → v2.0.02024-03-13

PHP version history (3 changes)v0.1.0PHP &gt;=5.4.0

v0.4.0PHP &gt;=5.5.0

1.0.0-betaPHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1219518?v=4)[Faiz Shukri](/maintainers/faizshukri)[@faizshukri](https://github.com/faizshukri)

---

Top Contributors

[![faizshukri](https://avatars.githubusercontent.com/u/1219518?v=4)](https://github.com/faizshukri "faizshukri (134 commits)")[![hussaini](https://avatars.githubusercontent.com/u/5404740?v=4)](https://github.com/hussaini "hussaini (7 commits)")

---

Tags

php-quranphpquranquransurahislammuslimquranal-qurankitabphpquran

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/faizshukri-phpquran/health.svg)

```
[![Health](https://phpackages.com/badges/faizshukri-phpquran/health.svg)](https://phpackages.com/packages/faizshukri-phpquran)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[php-soap/wsdl

Deals with WSDLs

183.8M18](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5155.1k17](/packages/phel-lang-phel-lang)

PHPackages © 2026

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