<?php

namespace App\Models;

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

class locations extends Model
{
    use HasFactory;
    protected $fillable = [
        'code',
        'location_name',
        'parent',
        'picture',
        'description',
    ];
    public function parent_info (){
        return $this->belongsTo(locations::class, "parent", "id");
    }
    public function stations(){
        return $this->hasMany(station::class,'parent_id','id');
    }
}
