Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 0d2d25b

Browse files
Close #5
1 parent f89b6c9 commit 0d2d25b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,12 @@ public function fields(Request $request)
3232
This will automatically use the `media` attribute on your model (which the `HasMediaTrait` adds).
3333

3434
**Note: You currently cannot create media directly from Nova.**
35+
36+
#### Registering the media resource
37+
If you'd like to use the media resource included with this package, you need to register it manually in your `NovaServiceProvider` in the `boot` method.
38+
39+
```php
40+
Nova::resources([
41+
\Kingsley\NovaMediaLibrary\Resources\Media::class
42+
]);
43+
```

src/NovaMediaLibraryServiceProvider.php

-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class NovaMediaLibraryServiceProvider extends ServiceProvider
2020
public function boot()
2121
{
2222
Nova::serving(function (ServingNova $event) {
23-
Nova::resources([
24-
\Kingsley\NovaMediaLibrary\Resources\Media::class
25-
]);
26-
2723
Nova::script('nova-media-library', __DIR__.'/../dist/js/app.js');
2824
Nova::style('nova-media-library', __DIR__.'/../dist/css/app.css');
2925
});

0 commit comments

Comments
 (0)