Download the PHP package esanj/public-pages without Composer
On this page you can find all versions of the php package esanj/public-pages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download esanj/public-pages
More information about esanj/public-pages
Files in esanj/public-pages
Package public-pages
Short Description Public pages for Laravel apps including home and error pages.
License MIT
Informations about the package public-pages
đ ī¸ Esanj Public Pages for Laravel
esanj/public-pages is a Laravel package that gives your application a clean, ready-to-use home page and a
complete set of HTTP error pages (400, 401, 403, 404, 419, 429, 500, 502, 503, 504), with bundled assets
(CSS, background image), built-in English & Persian translations, and full control through a simple config file.
Everything works out of the box. You only publish files when you want to customize them.
⨠Features
- â Pre-designed error pages for the 10 most common HTTP status codes
- đ Optional, configurable home page route
- đ Bundled front-end assets (CSS + background image)
- đ Multi-language support (English & Persian included, RTL-aware)
- đ¨ Fully customizable â publish and override views, assets, config & translations
- ⥠Zero configuration required to get started
đ Requirements
| Requirement | Version |
|---|---|
| PHP | 8.2, 8.3 or 8.4 |
| Laravel | 12.x or 13.x |
đĻ Installation
1. Install via Composer:
That's it â the package auto-registers itself. The home page and error pages are already active.
2. (Optional) Publish files you want to customize:
With no options, this publishes everything (views, assets, translations, and config). See Commands to publish only what you need.
đī¸ What Gets Published
| What | Published to |
|---|---|
| Home view | resources/views/vendor/publicpages/home.blade.php |
| Error views | resources/views/errors/ |
| Assets | public/assets/vendor/public-pages/ |
| Translations | lang/{locale}/publicpages.php |
| Config | config/esanj/public_pages.php |
File tree after a full install:
đ§Š Commands
| Command | What it does |
|---|---|
php artisan publicpages:install |
Publishes everything (views, assets, lang, config) |
php artisan publicpages:publish-views |
Publishes views and assets |
php artisan publicpages:publish-lang |
Publishes translation files |
php artisan publicpages:publish-config |
Publishes the config file |
publicpages:install also accepts flags to publish only part of the package:
âšī¸
publicpages:installalways overwrites existing files, so you can re-run it any time to pull in updates.
You can also publish directly with Laravel's vendor:publish using the package tags:
| Tag | Includes |
|---|---|
esanj-public-pages-views |
đ¨ Views |
esanj-public-pages-assets |
đ§Š Public assets |
esanj-public-pages-lang |
đ Translations |
esanj-public-pages-config |
âī¸ Config |
âī¸ Configuration
Publish the config file:
This creates config/esanj/public_pages.php. The full default config:
Common tweaks
Disable the home route (you provide your own /):
Change the home page path:
Use Laravel's default error pages instead of the package's:
Change the app name shown on the pages:
Apply extra middleware to the home route â edit config/esanj/public_pages.php:
đ To reset the configuration, delete
config/esanj/public_pages.phpand runphp artisan config:clear. The package falls back to its built-in defaults automatically.
đ Localization
Translations live in lang/{locale}/publicpages.php and ship with English (en) and Persian (fa).
The error layout automatically switches to RTL when the app locale is fa.
Publish them to customize:
File structure:
Reference any string in Blade with the publicpages::publicpages.* key:
Add another locale by creating lang/{locale}/publicpages.php (e.g. lang/es/publicpages.php) with the same
structure.
â Adding a New Error Page
Suppose you want to support 505 HTTP Version Not Supported.
1. Add the translations in lang/{locale}/publicpages.php under errors:
2. Create the view resources/views/errors/505.blade.php:
The shared errors::layout reads $code and pulls the matching title/message from your translation file â
no other wiring needed.
đ¨ Customizing the Look
- Views â after publishing, edit
resources/views/errors/layout.blade.php(the shared error layout) orresources/views/vendor/publicpages/home.blade.php(the home page). - Styles â edit
public/assets/vendor/public-pages/style.cssand thebackground.pngnext to it. -
Use your own error layout â point the config at it:
then create
resources/views/layouts/error-base.blade.phpwith your own markup.
đ For a complete, beginner-friendly, step-by-step walkthrough, see docs/GUIDE.md.
đ License
MIT Š 2025 â Esanj Team