Skip to content

Commit

Permalink
Update preparing-your-model.md (#3509)
Browse files Browse the repository at this point in the history
  • Loading branch information
bomshteyn authored Jan 15, 2024
1 parent baa604d commit 69c9afc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/basic-usage/preparing-your-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ The `Collection` component will show a preview thumbnail for items in the collec
To generate that thumbnail, you must add a conversion like this one to your model.

```php
use Spatie\Image\Manipulations;
use Spatie\Image\Enums\Fit;
use Spatie\MediaLibrary\MediaCollections\Models\Media;

public function registerMediaConversions(Media $media = null): void
{
$this
->addMediaConversion('preview')
->fit(Manipulations::FIT_CROP, 300, 300)
->fit(Fit::Contain, 300, 300)
->nonQueued();
}
```

0 comments on commit 69c9afc

Please sign in to comment.