<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Validator;

class OperatorNumber extends Model
{
    use HasFactory;

    protected $fillable = ['number','operator_id'];

    public function validate($input)
    {
        $validate = Validator::make($input, [
            'number' => 'required',
            'operator_id' => 'required',
        ]);

        return $validate;
    }

    public function operator(){
        return $this->belongsTo(Operator::class, 'operator_id', 'id');
    }
}
