Fix firstMedia() call to firstMedia since now it's a proper relationship and does not need to be called as a method.

This commit is contained in:
Andrius 2018-06-01 23:07:27 +02:00
parent 00014b521a
commit 9b82dd1e55
3 changed files with 4 additions and 4 deletions

View file

@ -25,7 +25,7 @@ class Status extends Model
public function thumb()
{
return url(Storage::url($this->firstMedia()->thumbnail_path));
return url(Storage::url($this->firstMedia->thumbnail_path));
}
public function url()

View file

@ -56,8 +56,8 @@ class ProfileOutbox extends Fractal\TransformerAbstract
// TODO: support more than 1 attachment
[
'type' => 'Document',
'mediaType' => $i->firstMedia()->mime,
'url' => $i->firstMedia()->url(),
'mediaType' => $i->firstMedia->mime,
'url' => $i->firstMedia->url(),
'name' => null
]
],

View file

@ -30,7 +30,7 @@
@if(!$status->media_path)
<td class="font-weight-bold">0</td>
@else
<td><div class="human-size" data-bytes="{{$status->firstMedia()->size}}">{{$status->firstMedia()->size}}</div></td>
<td><div class="human-size" data-bytes="{{$status->firstMedia->size}}">{{$status->firstMedia->size}}</div></td>
@endif
<td class="font-weight-bold">{{$status->created_at->diffForHumans(null, true, true, true)}}</td>
</tr>