sadegh19b/laravel-persian-lang

Persian language files for Laravel
1,993 15
Install
composer require sadegh19b/laravel-persian-lang
Latest Version:v2.2.0
Laravel:6 – 13
Older releases:5
License:MIT
Last Updated:May 30, 2026
Links: GitHub  ·  Packagist
Maintainer: sadegh19b

Laravel Persian Language Files

This package provides Persian language files for Laravel.

  • Support Laravel 6 to 13

Installation

Option 1: Via Composer (Recommended)

You can install the package via composer:

composer require sadegh19b/laravel-persian-lang

Option 2: Manual Installation

If you prefer not to use Composer, you can manually copy the language files:

  1. Download or clone this repository
  2. Copy the fa folder from lang/ to your Laravel application's lang/ directory
  3. The language files will be available in your application

Usage

Setting the Language

After installing the package, the Persian language files are automatically available without any additional configuration.

Simply set the locale to fa in your config/app.php file:

'locale' => 'fa',

Or set it dynamically in your code:

app()->setLocale('fa');

That's it! Now you can use Laravel's translation functions normally:

__('validation.required')           // فیلد الزامی است
__('auth.failed')                   // اطلاعات ورود نادرست است
__('passwords.reset')               // رمز عبور بازنشانی شد
trans('pagination.previous')        // قبلی

No need to publish or use any namespace! The package works automatically when your locale is set to fa.

Publishing Language Files (Optional)

If you want to customize the translations, you can optionally publish them:

php artisan vendor:publish --tag=persian-lang

This will copy the language files to lang/fa/ in your application. Your published files will automatically take precedence over the package files.

Validation attributes

If you want to change validation attributes, just copy the validation-attributes.php file to your lang/fa/ directory and don't need to publish other translation files.

Available Language Files

  • auth.php - Authentication related translations
  • passwords.php - Password reset related translations
  • validation.php - Validation related translations
  • validation-attributes.php - Validation attributes related translations (added by me)
  • pagination.php - Pagination related translations

Contributing

Please feel free to submit any issues or pull requests.

License

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

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

641,106,524 9,700
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

502,645,077 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

418,291,778 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Version Released Laravel License
v2.2.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v2.1.2 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.1.1 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.1.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.0.2 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT