From 9b82dd1e5537d2216335c2012f2aa21d6b7d7de2 Mon Sep 17 00:00:00 2001 From: Andrius Date: Fri, 1 Jun 2018 23:07:27 +0200 Subject: [PATCH] Fix `firstMedia()` call to `firstMedia` since now it's a proper relationship and does not need to be called as a method. --- app/Status.php | 2 +- app/Transformer/ActivityPub/ProfileOutbox.php | 4 ++-- resources/views/admin/statuses/home.blade.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Status.php b/app/Status.php index b63762904..45808191a 100644 --- a/app/Status.php +++ b/app/Status.php @@ -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() diff --git a/app/Transformer/ActivityPub/ProfileOutbox.php b/app/Transformer/ActivityPub/ProfileOutbox.php index 9d3b487cb..8c5457e8f 100644 --- a/app/Transformer/ActivityPub/ProfileOutbox.php +++ b/app/Transformer/ActivityPub/ProfileOutbox.php @@ -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 ] ], diff --git a/resources/views/admin/statuses/home.blade.php b/resources/views/admin/statuses/home.blade.php index f3f458556..957d51708 100644 --- a/resources/views/admin/statuses/home.blade.php +++ b/resources/views/admin/statuses/home.blade.php @@ -30,7 +30,7 @@ @if(!$status->media_path) 0 @else -
{{$status->firstMedia()->size}}
+
{{$status->firstMedia->size}}
@endif {{$status->created_at->diffForHumans(null, true, true, true)}}