psalm-plugin-laravel/tests/Models/Comment.php
2022-02-10 17:45:51 +01:00

29 lines
558 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Psalm\LaravelPlugin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
final class Comment extends Model
{
/**
* @psalm-return BelongsTo<Post>
*/
public function post(): BelongsTo
{
return $this->belongsTo(Post::class);
}
/**
* Get the owning commentable model.
*/
public function commentable(): MorphTo
{
return $this->morphTo();
}
}