Work on registration of existing systems to users

This commit is contained in:
Deon George
2022-03-14 22:28:54 +11:00
parent d68307461e
commit 8072f7c5a9
19 changed files with 553 additions and 56 deletions

View File

@@ -8,7 +8,9 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\File;
/**
* Class Setup
* This class represents our configuration.
*
* Our 'System' is defined by system_id, and from it we can find out our BBS name and addresses.
*
* @package App\Models
* @property Collection nodes
@@ -47,37 +49,6 @@ class Setup extends Model
// Our non model attributes and values
private array $internal = [];
public static function product_id(int $c=self::PRODUCT_ID): string
{
return hexstr($c);
}
/* RELATIONS */
public function system()
{
return $this->belongsTo(System::class);
}
/* ATTRIBUTES */
public function getLocationAttribute()
{
return $this->system->location;
}
public function getSysopAttribute()
{
return $this->system->sysop;
}
public function getSystemNameAttribute()
{
return $this->system->name;
}
/* METHODS */
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
@@ -143,6 +114,49 @@ class Setup extends Model
}
}
/**
* The Mailer Product ID in hex.
*
* @param int $c
* @return string
* @throws Exception
*/
public static function product_id(int $c=self::PRODUCT_ID): string
{
return hexstr($c);
}
/* RELATIONS */
/**
* The defined system that this setup is valid for
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function system()
{
return $this->belongsTo(System::class);
}
/* ATTRIBUTES */
public function getLocationAttribute()
{
return $this->system->location;
}
public function getSysopAttribute()
{
return $this->system->sysop;
}
public function getSystemNameAttribute()
{
return $this->system->name;
}
/* METHODS */
/* BINKP OPTIONS: BINKP_OPT_* */
public function binkpOptionClear(int $key): void