Download the PHP package rohit/laravel-localization without Composer

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

Very easy and light package for loclization. Routing based on available locales and easy to get rid of default language prefix from route

Installation

Composer

Add Laravel Localization to your composer.json file

"rohit/laravel-localization": "^1.0"

Run composer install to get the latest version of package

Or you can directly run the composer require command

composer require rohit/laravel-localization

Configuration

After the package install is completed you need to configure config/app.php and add Providers and Aliases

Vendor Publish

After the above steps, you need to publish vendor for this packge. It will create laravel-localization.php file under config folder. This folder contains the configuration for your locales.

php artisan vendor:publish --provider="Rohit\LaravelLocalization\LaravelLocalizationServiceProvider"

The file laravel-localization.php will contain the following structure

Here you can add as many locales available in your project and set the default_locale to the value for which you want to exclude the prefix

NOTE: You can keep this field blank if you want all prefix in th url

For Example:

If your project has en and th as the available locales and if you set th as your default locale. Then the url will look like,

For English: http://your_domain.com/en/your_page

For Thai http://your_domain.com/your_page

It will skip default locale th from the url

Middleware

After this, you need to update the app\Http\Kernel.php file and add the following line under routeMiddleware

Routing

Finally you can manage all the routes with this configuration and middleware for smooth operation

Update app\Http\routes.php file and add all your routes under this group

Helpers

There is a helper function to get the url for language switcher on the current page. You simply need to call a function with the locale

Localization::getLocaleUrl('en')

All versions of laravel-localization with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
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 rohit/laravel-localization contains the following files

Loading the files please wait ....