diff --git a/app/Models/Plan.php b/app/Models/Plan.php
index b718016..20a25d3 100644
--- a/app/Models/Plan.php
+++ b/app/Models/Plan.php
@@ -1,11 +1,13 @@
belongsToMany(User::class, 'plan_author', 'plan_id', 'user_id');
diff --git a/app/Presenters/PlanPresenter.php b/app/Presenters/PlanPresenter.php
new file mode 100644
index 0000000..85fcf1e
--- /dev/null
+++ b/app/Presenters/PlanPresenter.php
@@ -0,0 +1,22 @@
+getAuthor();
+
+ return Storage::url($author->profile_photo_path);
+ }
+
+ public function getAuthor()
+ {
+ return $this->author->first();
+ }
+}
diff --git a/resources/views/plan/index.blade.php b/resources/views/plan/index.blade.php
index 14803f2..c0790fe 100644
--- a/resources/views/plan/index.blade.php
+++ b/resources/views/plan/index.blade.php
@@ -49,7 +49,7 @@
@php
- $author = $plan->author()->first();
+ $author = $plan->present()->getAuthor;
@endphp
diff --git a/resources/views/plan/show.blade.php b/resources/views/plan/show.blade.php
index 473264f..ca3913f 100644
--- a/resources/views/plan/show.blade.php
+++ b/resources/views/plan/show.blade.php
@@ -1,10 +1,9 @@
@extends('layouts/eatvio')
@php
- $author = $plan->author()->first();
- $authorPhoto = Storage::url($author->profile_photo_path);
- if(is_null($author->profile_photo_path)) {
- $authorPhoto =$author->profile_photo_url;
- }
+
+ $author = $plan->present()->getAuthor;
+
+ $authorPhoto = $plan->present()->getAuthorPhoto;
$image = Storage::url($plan->image);
$planViewsCount = views($plan)->unique()->count();