Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sertxudev committed Jun 2, 2022
1 parent a213ead commit b28c20a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Message extends Model implements MediaInteraction
{
use HasMedia;

public function getMediaTable()
public function getMediaTable(): string
{
return 'messages_media';
}
Expand Down Expand Up @@ -105,12 +105,14 @@ php artisan media:create-table "App\Models\Message"

Once you configured the model, you can attach media files to it. For example:

> If you don't specify a disk, the default disk will be used.
```php
<?php

$message = Message::find(1);

$message->addMediaFromDisk('/images/image.jpg', 'public');
$message->addMediaFromDisk(path: '/images/image.jpg', disk: 'public');
```

You can also attach a remote file:
Expand Down

0 comments on commit b28c20a

Please sign in to comment.