소스 검색

Update Status model

Daniel Supernault 7 년 전
부모
커밋
2726f90584
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      app/Status.php

+ 3 - 0
app/Status.php

@@ -25,6 +25,9 @@ class Status extends Model
 
     public function thumb()
     {
+      if($this->media->count() == 0) {
+        return "data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
+      }
       return url(Storage::url($this->firstMedia()->thumbnail_path));
     }