public function thumbnail($type)
    {
        // We take image from posts field
        $image = $this->attributes['image'];
        // We need to get extension type ( .jpeg , .png ...)
        $ext = pathinfo($image, PATHINFO_EXTENSION);
        // We remove extension from file name so we can append thumbnail type
        $name = rtrim($image, '.'.$ext);
        // We merge original name + type + extension
        return $name.'-'.$type.'.'.$ext;
    }
public function thumbnail($type)
    {
        // We take image from posts field
        $image = $this->attributes['image'];
        // We need to get extension type ( .jpeg , .png ...)
        $ext = pathinfo($image, PATHINFO_EXTENSION);
        // We remove extension from file name so we can append thumbnail type
        $name = rtrim($image, '.'.$ext);
        // We merge original name + type + extension
        return $name.'-'.$type.'.'.$ext;
    }
public function thumbnail ( $ type ) { // We take image from posts field $ image = $ this -> attributes [ 'image' ] ; // We need to get extension type ( .jpeg , .png ...) $ ext = pathinfo ( $ image , PATHINFO_EXTENSION ) ; // We remove extension from file name so we can append thumbnail type $ name = rtrim ( $ image , '.' . $ ext ) ; // We merge original name + type + extension return $ name . '-' . $ type . '.' . $ ext ; }
Method for returning specific thumbnail for post.
Method for returning specific thumbnail for post .