Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chinleung authored Aug 6, 2019
1 parent 13cf50b commit 95cc5b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@ php artisan vendor:publish --provider="ChinLeung\LaravelLocales\LaravelLocalesSe

## Helpers

### locale() : string
### locale(string $locale = null) : string

> Update or retrieve the current locale of the application.
> Alias of `app()->getLocale();`.
```php
locale(string $locale = null); // 'en'
locale(); // 'en'

locale('fr'); // 'fr'
locale(); // 'fr'
```

### locales() : array
### locales(array $locales = null) : array

> Retrieve the supported locales of the application.
> Has priority for `app.locales` over `laravel-locales.supported`.
``` php
locales(); // ['en']

config(['locales.supported' => ['en', 'fr', 'zh']]);
locales(['en', 'fr', 'zh']);
locales(); // ['en', 'fr', 'zh']

config('app.locales' => ['en', 'zh']);
locales(['en', 'zh']);
locales(); // ['en', 'zh']
```

Expand Down

0 comments on commit 95cc5b0

Please sign in to comment.