Files
eatvio-infra/app/Presenters/PlanPresenter.php

26 lines
452 B
PHP

<?php
namespace App\Presenters;
use Illuminate\Support\Facades\Storage;
use Laracasts\Presenter\Presenter;
use App\Models\User;
/**
* @property User $author
*/
class PlanPresenter extends Presenter
{
public function getAuthorPhoto(): string
{
$author = $this->getAuthor();
return Storage::url($author->profile_photo_path);
}
public function getAuthor(): User
{
return $this->author->first();
}
}