Crop configuration for medias field in blocks
# ❓questions
d
when rendering an image
$block->image('cover', 'flexible')
, assuming I have the configurations below, how do I render a different crop variant of the same role
cover.flexible.free
cover.flexible.landscape
cover.flexible.portrait
?
Copy code
'cover' => [
                'default' => [
                    [
                        'name' => 'default',
                        'ratio' => 16 / 9,
                    ],
                ],
                'mobile' => [
                    [
                        'name' => 'mobile',
                        'ratio' => 1,
                    ],
                ],
                'flexible' => [
                    [
                        'name' => 'free',
                        'ratio' => 0,
                    ],
                    [
                        'name' => 'landscape',
                        'ratio' => 16 / 9,
                    ],
                    [
                        'name' => 'portrait',
                        'ratio' => 3 / 5,
                    ],
                ],
            ],
i
only one of those 3 flexible crops is stored in db. it allows users to choose one, not create separate crops
move your keys up if you want to store one for each
d
Thankyou, I see how it works now