taktik - laravel
This commit is contained in:
31
app/Models/Comment.php
Normal file
31
app/Models/Comment.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $content
|
||||
* @property CarbonInterface $created_at
|
||||
* @property CarbonInterface $updated_at
|
||||
*/
|
||||
class Comment extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\CommentFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['content'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo<Model, $this>
|
||||
*/
|
||||
public function commentable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user