<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;

class Category extends Model
{
    use Notifiable;

    protected $table = "categories";

    protected $fillable = ["name", "color"];

    protected $casts = [
        'created_at' => 'datetime:d-m-Y',
    ];

    public function post() {
        return $this->hasMany(Post::class);
    }
}
