Download the PHP package ashbin/nepali-date without Composer
On this page you can find all versions of the php package ashbin/nepali-date. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ashbin/nepali-date
More information about ashbin/nepali-date
Files in ashbin/nepali-date
Package nepali-date
Short Description A lightweight Laravel package for converting BS to AD and vice versa.
License
Informations about the package nepali-date
Laravel Nepali Date Converter
A lightweight, blazing-fast, and optimized Laravel package to convert Nepali Date (Bikram Sambat - BS) to English Date (Anno Domini - AD) and vice versa.
Instead of relying on complex and often inaccurate mathematical formulas, this package uses a highly accurate database-driven lookup approach based on the official Nepali calendar.
🚀 Features
- 100% Accurate BS to AD conversion.
- 100% Accurate AD to BS conversion.
- Easy-to-use Global Helper Functions (Great for Blade).
- Clean Facade support (Great for Controllers).
- Database-driven for lightning-fast micro-second queries.
- Zero configuration required.
📦 Installation
You can install the package via Composer into any Laravel project:
⚙️ Setup Instructions
After installing the package, you need to set up the database table and populate it with the official calendar data.
Run this commands in your terminal:
This will create a lightweight nepali_calendars table in your database and populates the accurate BS to AD mapped data.
🛠️ Usage
This package is designed for maximum Developer Experience (DX).
You can use it in two ways:
- Method 1: Global Helper Functions — Best for Blade & Quick Logic
- Method 2: NepDate Facade — Best for Controllers & Services
1️⃣ Method 1: Using Global Helper Functions
You can use these helper functions anywhere in your Laravel app without importing any classes.
BS to AD (Nepali to English)
Output:
AD to BS (English to Nepali)
Output:
Example in Blade Templates
2️⃣ Method 2: Using the Facade
If you prefer class-based static calls, you can use the NepDate facade.
The facade is auto-discovered, so you don't need to register it manually.
Example
BS to AD using Facade
Output:
AD to BS using Facade
Output:
📅 Supported Date Format
The package uses the following date format:
BS Date
AD Date
🔄 Conversion Examples
| BS Date | AD Date |
|---|---|
2083-04-25 |
2026-08-10 |
BS → AD
Output:
AD → BS
Output:
📄 License
The MIT License (MIT). Please see the License file for more information.
All versions of nepali-date with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
nesbot/carbon Version *