In my web app I am using Cloudinary for image storing. Image uploading is working properly but i want to create a custom attribute for image so when getting back the image url from the database with some modification with width and height.
The link of a image: https://res.cloudinary.com/wokong/image/upload/v1568570430/storyHeader/cxjir4g9tkaa8xepxodg.jpg
which is stored in database but when it fetch from the database, It should come with some scaling so that It wont take much time for website loading.
here is my StoryModel:
class Story extends Model
{
use Commentable, Searchable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title',
'summary',
'content',
'created_at',
'story_statuses_id',
'image', 'language',
'likes',
'views',
'url_key',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'is_public' => 'boolean',
];
I dont understand how to use it anyone can help?
cxjir4g9tkaa8xepxodg-160x160.jpg
,cxjir4g9tkaa8xepxodg240x240.jpg
etc – Cerlin