Skip to content

Commit

Permalink
Update defining-conversions.md (#3544)
Browse files Browse the repository at this point in the history
  • Loading branch information
misaf authored Feb 17, 2024
1 parent 4387a70 commit 30093e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/converting-images/defining-conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class YourModel extends Model implements HasMedia
{
use InteractsWithMedia;

public function registerMediaConversions(Media $media = null): void
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
->width(368)
Expand Down Expand Up @@ -70,7 +70,7 @@ use Spatie\Image\Enums\CropPosition;

// ...

public function registerMediaConversions(Media $media = null): void
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
->width(368)
Expand Down Expand Up @@ -101,7 +101,7 @@ This is how that looks like in the model:

```php
// in your model
public function registerMediaConversions(Media $media = null): void
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
->performOnCollections('images', 'downloads')
Expand All @@ -127,7 +127,7 @@ By default, a conversion will be added to the connection and queue that you've [

```php
// in your model
public function registerMediaConversions(Media $media = null): void
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
->width(368)
Expand All @@ -140,7 +140,7 @@ If you have set `queue_conversions_by_default` in the `media-library` config fil

```php
// in your model
public function registerMediaConversions(Media $media = null): void
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
->width(368)
Expand All @@ -158,7 +158,7 @@ true` on your model.
// in your model
public $registerMediaConversionsUsingModelInstance = true;

public function registerMediaConversions(Media $media = null): void
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
->performOnCollections('images', 'downloads')
Expand Down

0 comments on commit 30093e6

Please sign in to comment.