Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Nov 20, 2020
1 parent 07fdfc3 commit ce511b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ composer require optimistdigital/nova-translations-loader

## Usage

Inside a Laravel's `ServiceProvider`, run the `NovaTranslationsLoader::loadTranslations()` function:
Inside a Laravel's `ServiceProvider`, use the `LoadsNovaTranslations` trait and call `$this->loadTranslations()`:

```php
use OptimistDigital\NovaTranslationsLoader\NovaTranslationsLoader;
use OptimistDigital\NovaTranslationsLoader\LoadsNovaTranslations;

class SomePackagesServiceProvider extends ServiceProvider
{
use LoadsNovaTranslations;

public function boot()
{
// ...
Expand All @@ -41,7 +43,7 @@ class SomePackagesServiceProvider extends ServiceProvider
* @return null
**/

NovaTranslationsLoader::loadTranslations(__DIR__ . '/../resources/lang', 'nova-some-package', true);
$this->loadTranslations(__DIR__ . '/../resources/lang', 'nova-package', true);

// ...
}
Expand Down

0 comments on commit ce511b1

Please sign in to comment.