Download the PHP package sahifa/laravel without Composer
On this page you can find all versions of the php package sahifa/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sahifa/laravel
More information about sahifa/laravel
Files in sahifa/laravel
Package laravel
Short Description Laravel package for Sahifa: Arabic-ready HTML to PDF and screenshots, rendered in Saudi Arabia. Render Blade views to PDF without dompdf's Arabic problems.
License MIT
Homepage https://sahifa.dev/en/docs
Informations about the package laravel
Sahifa for Laravel
Render Blade views to PDF with Arabic text that actually works: joined letters, correct word order, mixed Arabic and English, with Arabic fonts ready. Rendered by Chromium on Sahifa's servers in Saudi Arabia, so there is no browser to install and nothing to configure in your Laravel app.
If you came here because dompdf shows Arabic as ???? or as disconnected letters, this is the fix: dompdf does not shape Arabic, a browser engine does.
Installation
Add your key to .env (get a free one at sahifa.dev: 100 renders a month, no card needed):
The service provider and the Sahifa facade are registered automatically. To change the defaults, publish the config:
Requirements: PHP 8.2+, Laravel 12 or 13.
Usage
PDF from a Blade view
Inside the page footer and header, {{page}} and {{total}} are replaced with page numbers. In a Blade file write them as @{{page}} so Blade leaves them alone.
PDF from HTML or a URL
All PDF options are passed through: format, landscape, margin, header, footer, css, javascript, delay, wait_for, pages, zoom.
Screenshots
See the screenshot options.
Mail attachments
An Arabic invoice view
- Put
dir="rtl"on<html>, so tables and layout mirror. - Wrap left-to-right parts (VAT numbers, IBANs, amounts, e-mails) in
<bdi dir="ltr">. Sahifa\Laravel\Sahifa::arabicDocument($fragment)wraps a fragment in a full RTL document with Arabic fonts.
Errors and retries
Failures throw Sahifa\Laravel\Exceptions\SahifaException with ->status, ->errorCode and the API's message. Busy and rate-limit responses (429, 502, 503, 504) and network errors are retried (SAHIFA_RETRIES, default 3), waiting for Retry-After.
Testing your app
The package uses Laravel's HTTP client, so Http::fake() works:
Why Sahifa
- Arabic done right: Chromium shaping and bidi, Arabic fonts preinstalled.
- In the Kingdom: documents are rendered in Jeddah and not stored. Data residency.
- Nothing to run: no Chrome, no fonts, no queue workers in your containers.
Documentation · Examples in five languages · Pricing · Support: [email protected]
MIT License. Sahifa is a service of Yimello LLC.
All versions of laravel with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/view Version ^12.0|^13.0
guzzlehttp/guzzle Version ^7.5