File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
resources/views/json-media Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 11<div class =" flex" >
22 <figure class =" w-full" >
3- <img class =" object-cover w-full" loading =" lazy"
3+ <img class =" object-cover w-full {{ $media -> imgClass } } " loading =" lazy"
44 src =" {{ $media -> getCropUrl (width : $media -> width ,height : $media -> height ) } }"
55 alt =" {{ $media -> getCustomProperty (' alt' ) } }"
66 width =" {{ $media -> width } }"
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public function __construct(
2424 protected array $ content ,
2525 public int $ width = 250 ,
2626 public int $ height = 180 ,
27+ public ?string $ imgClass = null ,
2728 ) {
2829 $ this ->getDisk ();
2930 }
@@ -85,10 +86,11 @@ public function getCustomProperty(string $property): mixed
8586 return $ this ->getContentKeyValue ('customProperties. ' . $ property );
8687 }
8788
88- public function withImageProperties (int $ width , int $ height ): Media
89+ public function withImageProperties (int $ width , int $ height, ? string $ imgClass = null ): Media
8990 {
9091 $ this ->width = $ width ;
9192 $ this ->height = $ height ;
93+ $ this ->imgClass = $ imgClass ;
9294
9395 return $ this ;
9496 }
You can’t perform that action at this time.
0 commit comments