Download the PHP package laraveledge/laravel-locale without Composer

On this page you can find all versions of the php package laraveledge/laravel-locale. 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-locale

Laravel Locale

Elegant URL-Based Localization for Laravel Applications

Laravel Locale is a simple yet powerful package for handling localization through URL segments in Laravel. It detects, validates, and manages locale slugs (e.g., /en, /tr) in the request path, with seamless support for session storage, normalization, and middleware-based behavior.


πŸ“š Table of Contents


πŸš€ Installation

Install via Composer:


βš™οΈ Configuration

Publish the configuration file:

This will publish config/locale.php, where you can specify your supported locales:


🧩 Usage

Wrap your localized routes using middleware and a {locale} prefix:

Now visit /, /about, or /test to be redirected to the localized versions.


πŸ“Œ Alias Usage

You can also register aliases in bootstrap/app.php to avoid referencing class paths directly:


🚦 Middleware Setup

To avoid conflicts with Laravel’s internal URL binding, make sure to set middleware priority properly:

🚦 Full Setup (Copy Paste) - Recommended:

🧠 Locale Detection Order

The package detects locale using the following order:

  1. Session – If a locale exists in session, it is used.
  2. URL Segment – First segment of the path.
  3. Browser Preferred Language – Based on Accept-Language header.
  4. Fallback Locale – As defined in app.fallback_locale.

⚠️ Edge Cases

βœ… Solution: Always define a Route::fallback() within your {locale} route group to ensure nested and parameterized routes also get redirected when the locale is missing.

βœ… What This Package Does


πŸ™Œ Inspired by the Greats β€” Built with Simplicity

This package is inspired by:

These packages have served the Laravel ecosystem well and offer a wide range of features. However, as Laravel modernized its routing and middleware pipeline, we felt the need for a simpler, lighter, and middleware-first approach β€” without route macros or runtime route manipulation.


🎯 Why This Package Exists

In real-world projects:

This package solves that by offering:

βœ… Clean, Laravel-native routing
βœ… No macros β€” just plain Route::get() and Route::group()
βœ… Middleware-first lifecycle control
βœ… SEO-optimized URL redirection and normalization
βœ… Works great with Livewire, Inertia, Blade, APIs, SPAs
βœ… Debug-friendly (Locale::debug())
βœ… Lightweight, transparent, and easy to extend


πŸ“¦ What This Package Is (and Isn't)

This package intentionally starts simple.

It currently does not offer some of the advanced features available in mcamara or codezero such as:

We plan to add more features in future versions β€” while staying true to the Laravel philosophy of clarity over magic.


🧠 Choose Based on Your Needs

----------------------------------- ---------------------------------------- You Should Use This Package If...
You want a lightweight, zero-config localization system
You prefer Laravel-native routes with no macros
You value predictable middleware-based flow
You’re building something new and modern
----------------------------------- ----------------------------------------
You Might Prefer Other Packages If...
----------------------------------- ----------------------------------------
You need automatic route translation
You don’t mind learning route macros
You need deeply integrated i18n features
You’re maintaining legacy systems

πŸš€ Just Use It β€” You’ll Feel the Difference

Install it, add middleware, define routes β€” and you’re done.

πŸ“ Folder Structure


βœ… Requirements


πŸ“„ License

This package is open-source and released under the MIT License.


All versions of laravel-locale with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/session Version ^10.0|^11.0|^12.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 laraveledge/laravel-locale contains the following files

Loading the files please wait ....