Skip to content

Commit 9f12183

Browse files
authored
Merge pull request #4 from mephir/feature/trans-provider
update readme
2 parents 761cd0d + 8bf265c commit 9f12183

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,38 @@ To install this package you will need:
1111

1212
* PHP 7.1+
1313

14-
Run
14+
Run
1515

1616
`composer require nstack/laravel-sdk`
1717

1818
or setup in composer.json
1919

2020
`nstack/laravel-sdk: 1.0.x`
2121

22+
In `config/app.php` (Laravel) or `bootstrap/app.php` (Lumen) you should replace Laravel's translation service provider
23+
24+
```php
25+
Illuminate\Translation\TranslationServiceProvider::class,
26+
```
27+
28+
by the one included in this package:
29+
30+
```php
31+
NStack\ServiceProvider::class
32+
```
2233

2334
Setup in config/app.php
2435

2536
```php
2637

27-
'providers' =>
38+
'providers' =>
2839
[
2940
....
41+
// Illuminate\Translation\TranslationServiceProvider::class
3042
NStack\ServiceProvider::class
3143
]
3244

33-
'aliases' =>
45+
'aliases' =>
3446
[
3547
....
3648
'NStack' => NStack\Facade::class,
@@ -53,17 +65,21 @@ You can now call via facade, eg:
5365
\NStack::getContinentsClient()->index()
5466
````
5567

56-
or via globa func
68+
or via global function
5769

5870
```php
5971
nstack()->getContinentsClient()->index()
6072
```
6173

62-
All PHP functionality can be found
74+
or via integration with `trans()` [helper](https://laravel.com/docs/5.8/helpers#method-trans)
6375

64-
[Link](https://github.com/nstack-io/php-sdk)
76+
```php
77+
echo trans('messages.welcome');
78+
```
6579

80+
All PHP functionality can be found
6681

82+
[Link](https://github.com/nstack-io/php-sdk)
6783

6884
## 🏆 Credits
6985

0 commit comments

Comments
 (0)