Files
productalert/app/Models/Author.php
2023-07-27 02:18:38 +08:00

51 lines
784 B
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Author
*
* @property int $id
* @property string $name
* @property string $avatar
* @property string $bio
* @property bool $enabled
* @property bool $public
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @property Collection|Post[] $posts
*
* @package App\Models
*/
class Author extends Model
{
protected $table = 'authors';
protected $casts = [
'enabled' => 'bool',
'public' => 'bool'
];
protected $fillable = [
'name',
'avatar',
'bio',
'enabled',
'public'
];
public function posts()
{
return $this->hasMany(Post::class);
}
}