<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class State extends Model
{
    use HasFactory;

    /**
	 * Manually Define Table Name.  
	 * 
	 * @var string 
	 */
    protected $table = 'states';

    /**
	 * Define Relationships that must always be loaded. 
	 * 
	 * @var array 
	 */
	protected $with = 
	[
		//...
	];

	/**
	 * Define attributes that are mass assignable. 
	 * 
	 * @var array 
	 */
    protected $fillable = 
    [
        //...
    ];

	/**
	 * Define attributes that should be hidden for arrays. 
	 * 
	 * @var array 
	 */
    protected $hidden = 
	[
		//...
    ];

	//** Accessors & Mutators */

	//...

	//** belongsTo, belongsToMany, hasOne, hasMany relationships */ 

	/**
	 * Fetch ZipcodeRange hasMany relationship 
	 * 
	 * // @return ? 
	 */
	public function zipCodeRange() // : ? 
	{
		return $this->hasMany(
			related   : ZipcodeRange::class,
			foreignKey: "state_id",
			localKey  : "id"
		);
	}
}
