Download the PHP package josiasmontag/laravel-localization without Composer

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

Laravel Localization

Build Status Total Downloads Latest Stable Version License

Introduction

The Laravel Localization package is built for Laravel 5.5+ and provides:

Installation

To get started, use Composer to add the package to your project's dependencies:

composer require josiasmontag/laravel-localization

Add the HandleLocalization Middleware to the web group in App/Http/Kernel.php:

Configuration

To publish the config file to config/localization.php:

php artisan vendor:publish --provider "Lunaweb\Localization\LocalizationServiceProvider"

Default configuration:

Usage

Prefix Based Localized Routes

To add localized routes with language prefixes, edit your routes/web.php and use localizedRoutesGroup helper:

Under the hood this will create the following routes for you:

Route Route Name Language
/ index English (Default Language)
/de de.index German
/fr fr.index French
/register register English (Default Language)
/de/register de.register German
/fr/register fr.register French

Domain Based Localized Routes

To add domain-based localized routes, add the localized domains to your config/localization.php configuration:

The example from above will then create the following routes:

Route Route Name Language
domain.com index English (Default Language)
domain.de de.index German
domain.fr fr.index French
domain.com/register register English (Default Language)
domain.de/register de.register German
domain.fr/register fr.register French

Localization Specific Routes

You can manually create language specific routes using the localization() macro.

Helpers

Localized route()

route() will automatically use the localized version, if there is any available. Using the example from above, route('index') resolves to the index, de.index or fr.index route depending on the user's language.

Check if the current route is localized

or...

Get the localization of the current route

Get the URL to a different language version of the current route

Get the route name to a different language version of the current route

Hreflang Meta Tags

Language Switcher


All versions of laravel-localization with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
laravel/framework Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.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 josiasmontag/laravel-localization contains the following files

Loading the files please wait ....