Skip to content

Commit

Permalink
Simplify installation process (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtucek authored and Marc Cámara committed Apr 25, 2017
1 parent 09d3157 commit 3d487d4
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,24 @@ Laravel 5 is released!!

## Installation

### Composer
Install the package via composer: `composer require mcamara/laravel-localization`

Add Laravel Localization to your `composer.json` file.

"mcamara/laravel-localization": "1.2.*"

Run `composer install` to get the latest version of the package.

### Manually

It's recommended that you use Composer, however you can download and install from this repository.

### Laravel

Laravel Localization comes with a service provider for Laravel. You'll need to add it to your `composer.json` as mentioned in the above steps, then register the service provider with your application.

Open `config/app.php` and find the `providers` key. Add `LaravelLocalizationServiceProvider` to the array.
Register the ServiceProvider in `config/app.php`

```php
...
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class
...
'providers' => [
// [...]
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
],
```

You can also add an alias to the list of class aliases in the same file.
You may also register the `LaravelLocalization` Facade:

```php
...
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class
...
'aliases' => [
// [...]
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
],
```

## Usage
Expand Down Expand Up @@ -429,7 +417,7 @@ function() {
Route::get(LaravelLocalization::transRoute('routes.about'), function() {
return View::make('about');
});

Route::get(LaravelLocalization::transRoute('routes.view'), function($id) {
return View::make('view',['id'=>$id]);
});
Expand Down

0 comments on commit 3d487d4

Please sign in to comment.