Skip to content

Commit 2112f0d

Browse files
committed
docs
1 parent 09d58a4 commit 2112f0d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ $post->body->galleryAttachments()
382382
You may want to attach resources that don't need to be stored in the database. One example of this is perhaps storing the OpenGraph Embed of links in a chat message. You probably don't want to store each OpenGraph Embed as its own database record. For cases like this, where the integraty of the data isn't necessarily key, you may register a custom attachment resolver:
383383

384384
```php
385+
use App\Models\Opengraph\OpengraphEmbed;
385386
use Illuminate\Support\ServiceProvider;
386387
use Tonysm\RichTextLaravel\RichTextLaravel;
387388

@@ -401,6 +402,8 @@ class AppServiceProvider extends ServiceProvider
401402
This resolver must either return an instance of an `AttachableContract` implementation or `null` if the node doesn't match your attachment. In this case of an `OpengraphEmbed`, this would look something like this:
402403

403404
```php
405+
namespace App\Models\Opengraph;
406+
404407
use DOMElement;
405408
use Tonysm\RichTextLaravel\Attachables\AttachableContract;
406409

0 commit comments

Comments
 (0)