<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;

class Continent extends Model
{
    protected $primaryKey = 'id';
    protected $fillable   = ['name', 'slug', 'emoji', 'color_from', 'color_to', 'posts_count'];

    public function countries() { return $this->hasMany(Country::class); }
    public function posts()     { return $this->hasMany(Post::class); }
    public function sources()   { return $this->hasManyThrough(Source::class, Country::class); }
}
