Files
eatvio-infra/app/Presenters/PlanPresenter.php
2024-01-09 15:33:59 +03:00

26 lines
451 B
PHP

<?php
namespace App\Presenters;
use App\Models\User;
use Illuminate\Support\Facades\Storage;
use Laracasts\Presenter\Presenter;
/**
* @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();
}
}