12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- /**
- * 国家/地区.
- *
- * @property string $code ISO国家代码
- * @property string $name 名称
- * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Node[] $nodes
- * @property-read int|null $nodes_count
- * @method static \Illuminate\Database\Eloquent\Builder|Country newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|Country newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|Country query()
- * @method static \Illuminate\Database\Eloquent\Builder|Country whereCode($value)
- * @method static \Illuminate\Database\Eloquent\Builder|Country whereName($value)
- * @mixin \Eloquent
- */
- class Country extends Model
- {
- public $timestamps = false;
- public $incrementing = false;
- protected $table = 'country';
- protected $primaryKey = 'code';
- protected $keyType = 'string';
- protected $guarded = [];
- public function nodes()
- {
- return $this->hasMany(Node::class, 'country_code');
- }
- }
|