<?php

namespace App\Models;

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

class company extends Model
{
    use HasFactory;

    protected $fillable = [
        'code',
        'plant',
        'parent',
        'building',
        'picture',
        'description',
    ];
    public function parent_info (){
        return $this->belongsTo(company::class, "parent", "id");
    }
    public function stations(){
        return $this->hasMany(station::class,'parent_id');
    }
}
