'required', 'long' => 'required', ]; /** * Rules ensuring that the raw data stored in the database meets expectations. * * @var array */ protected static $dataIntegrityRules = [ 'short' => 'string|between:1,60|unique:locations,short', 'long' => 'string|between:1,255', ]; /** * Gets the nodes in a specificed location. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function nodes() { return $this->hasMany(Node::class); } /** * Gets the servers within a given location. * * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough */ public function servers() { return $this->hasManyThrough(Server::class, Node::class); } }