Skip to content
Devix Open Source

Guide

Getting started

composer require devix-labs/laravel-prayer-times
php artisan vendor:publish --tag=prayer-times-config

Set the place once:

// config/prayer-times.php
'latitude' => 25.2048,
'longitude' => 55.2708,
'timezone' => 'Asia/Dubai',
'country' => 'AE',

country is usually better than method: it brings the method that country's timetables use and the minute adjustments its authority publishes. The UAE, for instance, adds three minutes to Dhuhr, Asr and Maghrib and takes three off sunrise — which is why a timetable computed from raw angles never quite matches the mosque.

Today

use Devix\PrayerTimes\Laravel\Facades\Prayers;

$times = Prayers::today();
$times->format(Prayers::timeZone());
// ['fajr' => '04:46', 'sunrise' => '06:01', 'dhuhr' => '12:18', 'asr' => '15:46', 'maghrib' => '18:29', 'isha' => '19:44']

$times->fajr;          // a DateTimeImmutable in UTC
$times->method->name;  // 'UAE — General Authority of Islamic Affairs'
$times->estimated;     // true only where a high-latitude rule had to stand in

In Blade

<ul>
    <li>Fajr @prayerTime('fajr')</li>
    <li>Dhuhr @prayerTime('dhuhr')</li>
    <li>Maghrib @prayerTime('maghrib', 'g:i a')</li>
</ul>

A countdown

$next = Prayers::next();
// ['name' => 'asr', 'time' => DateTimeImmutable, 'inMinutes' => 96]

Prayers::current();    // 'dhuhr'

A timetable

foreach (Prayers::month(2026, 9) as $day) {
    $row = $day->format(Prayers::timeZone());
}

Or from the command line:

php artisan prayer:times
php artisan prayer:times --date=2026-09-12 --madhab=hanafi
php artisan prayer:times --month=2026-09

Another place, for one call

Prayers::for('2026-09-12', ['latitude' => 51.5074, 'longitude' => -0.1278, 'country' => 'GB']);

Everything not passed falls back to the config, so a multi-city application overrides only what differs.

Qiyam and the qibla

Prayers::nightPortions();   // ['middle' => …, 'lastThird' => …]
Prayers::qibla();           // ['bearing' => 258.23, 'compass' => 'WSW', 'distance' => 1631]

Matching a particular mosque

'adjustments' => ['fajr' => -2, 'isha' => 3],

These stack on top of the method's own.

High latitudes

North of about 48° the sun sometimes never goes far enough below the horizon, and inside the polar circles it may not rise at all. Set the rule in config:

'high_latitude_rule' => 'middle-of-the-night',   // or seventh-of-the-night, twilight-angle, none

Where the sun does not rise or set, the day length of the nearest date that does is borrowed. Any result that needed either carries estimated: true — show it.

How it is checked

Two fixtures run in this package's test suite: 1 210 comparisons against adhan (every time within a minute) and 704 vectors from the JavaScript package, which this matches exactly. That is why a timetable rendered here and refreshed in the browser cannot disagree.

Updated 15 Sep 2026