<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Network
 *
 * @property int $id
 * @property string $full_name
 * @property string $nice_name
 * @property string $code
 * @property int $country_id
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property float $sms_price
 * @property string $prefix
 * @property-read \App\Country $country
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\UserNetwork[] $user_networks
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereCode($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereCountryId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereFullName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereNiceName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network wherePrefix($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereSmsPrice($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Network whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Network extends Model
{
    protected $fillable = ['full_name', 'nice_name', 'code', 'country_id', 'sms_price', 'prefix'];

    public function country() {
        return $this->belongsTo('App\Country');
    }

    public function user_networks() {
        return $this->hasMany('App\UserNetwork');
    }
}
