]> BookStack Code Mirror - bookstack/blobdiff - app/User.php
Added migration file.
[bookstack] / app / User.php
index afcd9af70c4f8094cea9fa52c9bfc0eaefa43068..264723be9c615a8477ea47fd1be670c3756cf405 100644 (file)
@@ -22,7 +22,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      * The attributes that are mass assignable.
      * @var array
      */
-    protected $fillable = ['name', 'email', 'image_id'];
+    protected $fillable = ['name', 'email', 'image_id', 'books_view_type' ];
 
     /**
      * The attributes excluded from the model's JSON form.
@@ -165,7 +165,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
         if ($imageId === 0 || $imageId === '0' || $imageId === null) return $default;
 
         try {
-            $avatar = baseUrl($this->avatar->getThumb($size, $size, false));
+            $avatar = $this->avatar ? baseUrl($this->avatar->getThumb($size, $size, false)) : $default;
         } catch (\Exception $err) {
             $avatar = $default;
         }