Skip to content
Discussion options

You must be logged in to vote

Made some tweaks to the Avatar and Image fields. In the next version, an aspect method will allow you to set the image's aspect ratio. Nova will not assume the aspect ratio by default, meaning your Avatar fields will not be presumed to be square.

use Laravel\Nova\Fields\Image;

Image::make('Image')
    ->indexWidth(70)
    ->detailWidth(300)
    ->rounded()
    ->aspect(Image::ASPECT_SQUARE)

The options available are:

  • ASPECT_SQUARE
  • ASPECT_AUTO

I've also added indexWidth and detailWidth methods to allow you to specify separate sizes for each view. It's important to note, maxWidth will override both of those for compatibility purposes, but is now null by default.

Replies: 7 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@mrleblanc101
Comment options

@crynobone
Comment options

@mrleblanc101
Comment options

@mrleblanc101
Comment options

@kichetof
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by davidhemphill
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented Feature Request implemented
4 participants
Converted from issue

This discussion was converted from issue #4920 on October 17, 2022 04:00.