]> BookStack Code Mirror - bookstack/blobdiff - app/Image.php
Trying to make the tests green.
[bookstack] / app / Image.php
index 4600e5b1bcb2028258ccd38f328411f2a09b15a6..ad23a077adc5ba12cb652ad55043fa3289101f4d 100644 (file)
@@ -1,10 +1,21 @@
-<?php
+<?php namespace BookStack;
 
-namespace Oxbow;
+use Images;
 
-use Illuminate\Database\Eloquent\Model;
-
-class Image extends Model
+class Image extends Ownable
 {
-    //
+
+    protected $fillable = ['name'];
+
+    /**
+     * Get a thumbnail for this image.
+     * @param  int       $width
+     * @param  int       $height
+     * @param bool|false $keepRatio
+     * @return string
+     */
+    public function getThumb($width, $height, $keepRatio = false)
+    {
+        return Images::getThumbnail($this, $width, $height, $keepRatio);
+    }
 }