]> BookStack Code Mirror - bookstack/blobdiff - app/Image.php
Update all.blade.php
[bookstack] / app / Image.php
index 9d2835dc3e3763375aec36d5d7d32017e84909d4..ad23a077adc5ba12cb652ad55043fa3289101f4d 100644 (file)
@@ -1,23 +1,21 @@
-<?php
+<?php namespace BookStack;
 
-namespace Oxbow;
+use Images;
 
-use Illuminate\Database\Eloquent\Model;
-
-class Image extends Model
+class Image extends Ownable
 {
-    public function getFilePath()
-    {
-        return storage_path() . $this->url;
-    }
 
-    public function createdBy()
-    {
-        return $this->belongsTo('Oxbow\User', 'created_by');
-    }
+    protected $fillable = ['name'];
 
-    public function updatedBy()
+    /**
+     * 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 $this->belongsTo('Oxbow\User', 'updated_by');
+        return Images::getThumbnail($this, $width, $height, $keepRatio);
     }
 }