62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class OperatorsCountry
|
|
*
|
|
* @property int $id
|
|
* @property int $id_operator
|
|
* @property int $id_country
|
|
* @property string|null $adresse
|
|
* @property string|null $code
|
|
* @property bool $status
|
|
*
|
|
* @property Operator $operator
|
|
* @property Country $country
|
|
* @property Collection|NetworksOperator[] $networks_operators
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class OperatorsCountry extends Model
|
|
{
|
|
protected $table = 'operators_countries';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'id_operator' => 'int',
|
|
'id_country' => 'int',
|
|
'status' => 'bool'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'id_operator',
|
|
'id_country',
|
|
'adresse',
|
|
'code',
|
|
'status'
|
|
];
|
|
|
|
public function operator()
|
|
{
|
|
return $this->belongsTo(Operator::class, 'id_operator');
|
|
}
|
|
|
|
public function country()
|
|
{
|
|
return $this->belongsTo(Country::class, 'id_country');
|
|
}
|
|
|
|
public function networks_operators()
|
|
{
|
|
return $this->hasMany(NetworksOperator::class, 'id_operator_country');
|
|
}
|
|
}
|