Add (lqip)
This commit is contained in:
@@ -87,4 +87,15 @@ public function getHtmlBodyAttribute()
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
public function getFeaturedImageLqipAttribute()
|
||||
{
|
||||
$featuredImage = $this->featured_image;
|
||||
|
||||
// Get the extension of the original featured image
|
||||
$extension = pathinfo($featuredImage, PATHINFO_EXTENSION);
|
||||
|
||||
// Append "_lqip" before the extension to create the LQIP image URL
|
||||
return str_replace(".{$extension}", "_lqip.{$extension}", $featuredImage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user