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() public function thumb()
{ {
return url(Storage::url($this->firstMedia()->thumbnail_path)); return url(Storage::url($this->firstMedia->thumbnail_path));
} }
public function url() public function url()

View File

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

View File

@ -30,7 +30,7 @@
@if(!$status->media_path) @if(!$status->media_path)
<td class="font-weight-bold">0</td> <td class="font-weight-bold">0</td>
@else @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 @endif
<td class="font-weight-bold">{{$status->created_at->diffForHumans(null, true, true, true)}}</td> <td class="font-weight-bold">{{$status->created_at->diffForHumans(null, true, true, true)}}</td>
</tr> </tr>