Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
|
@ -22,29 +25,20 @@ class DatabaseHost extends Model
|
|||
*/
|
||||
public const RESOURCE_NAME = 'database_host';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $immutableDates = true;
|
||||
protected bool $immutableDates = true;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'database_hosts';
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = ['password'];
|
||||
|
||||
/**
|
||||
* Fields that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'host', 'port', 'username', 'password', 'max_databases', 'node_id',
|
||||
|
@ -52,8 +46,6 @@ class DatabaseHost extends Model
|
|||
|
||||
/**
|
||||
* Cast values to correct type.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
|
@ -63,10 +55,8 @@ class DatabaseHost extends Model
|
|||
|
||||
/**
|
||||
* Validation rules to assign to this model.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $validationRules = [
|
||||
public static array $validationRules = [
|
||||
'name' => 'required|string|max:191',
|
||||
'host' => 'required|string',
|
||||
'port' => 'required|numeric|between:1,65535',
|
||||
|
@ -77,20 +67,16 @@ class DatabaseHost extends Model
|
|||
|
||||
/**
|
||||
* Gets the node associated with a database host.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function node()
|
||||
public function node(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Node::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databases associated with this host.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function databases()
|
||||
public function databases(): HasMany
|
||||
{
|
||||
return $this->hasMany(Database::class);
|
||||
}
|
||||
|
|
Reference in a new issue