Download the PHP package dev1191/laravel-bs-eloquent without Composer

On this page you can find all versions of the php package dev1191/laravel-bs-eloquent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-bs-eloquent

First-class Bikram Sambat (Nepali Date) Eloquent Casts, Scopes, and Validation for Laravel 10 - 13

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A modern, high-performance Laravel package for Bikram Sambat (BS / Nepali Date). It stores standard Gregorian (AD) dates in your database to preserve SQL index performance, while giving you transparent Eloquent casts, scopes, Nepali fiscal year calculations, and a full suite of FormRequest validation rules.


✨ Key Features


📦 Installation

Install the package via Composer:

Publish the configuration file (optional):

The published config/bikram-sambat.php:


🚀 Usage

1. Eloquent Model Casting

Add the cast to your model:

Writing BS Dates:

Reading BS Dates:


2. Eloquent Query Scopes

All queries automatically convert BS boundaries to Gregorian dates so your SQL index remains fast and untouched:


3. FormRequest Validation Rules

Use custom validation rules or standard string rule aliases:


4. Artisan CLI Conversion

Output:


5. Date Manipulation & Carbon Parity (BsDate)

The BsDate object provides Carbon-like fluent operations designed specifically for Bikram Sambat calendar rules:

Fluent Date Arithmetic:

Period Boundaries:

Relative Time Localization (diffForHumans):

Extended Format Tokens:

$date->format($pattern, inDevanagari: false, locale: null) supports standard PHP date() specifiers adapted to BS:

Token Description Example (BS)
d 2-digit day of month with leading zeros 01 to 32
j Day of month without leading zeros 1 to 32
l Full day of the week Sunday / आइतबार
D 3-letter / short day of the week Sun / आइत
w Numeric day of week (0 for Sunday, 6 for Saturday) 0
N ISO-8601 numeric day of week (1 for Monday, 7 for Sunday) 7
S English ordinal suffix for the day st, nd, rd, th
m 2-digit month with leading zeros 01 to 12
n Month without leading zeros 1 to 12
F Full month name Baisakh / बैशाख
M Short month name Bai / बै
t Number of days in the given BS month 31
Y 4-digit BS year 2081
y 2-digit BS year 81
L Whether it is a leap year (366 days) 1 or 0
Q Fiscal quarter (1 to 4) 4
x Fiscal year string 2080/81

Carbon Status Checks:


5. Artisan CLI Conversion Command

Quickly inspect and convert dates directly from the command line without opening a tinker session:

Sample Output:


🧪 Testing

Run tests with Pest:


🤝 Contributing

Please see CONTRIBUTING.md for detailed guidelines on the Git workflow, branching strategy, testing requirements, and commit conventions.


📄 License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-bs-eloquent with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2 || ^8.3 || ^8.4
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0 || ^11.0||^12.0||^13.0
illuminate/database Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/validation Version ^10.0 || ^11.0 || ^12.0 || ^13.0
nesbot/carbon Version ^2.62 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dev1191/laravel-bs-eloquent contains the following files

Loading the files please wait ...