Upgrade to Laravel 9 (#4413)

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner 2022-10-14 10:59:20 -06:00 committed by GitHub
parent 95e15d2c8a
commit cbcf62086f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
573 changed files with 4387 additions and 9411 deletions

View file

@ -9,6 +9,7 @@ use Pterodactyl\Events\ActivityLogged;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\MassPrunable;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Model as IlluminateModel;
@ -45,6 +46,7 @@ use Illuminate\Database\Eloquent\Model as IlluminateModel;
* @method static Builder|ActivityLog whereIp($value)
* @method static Builder|ActivityLog whereProperties($value)
* @method static Builder|ActivityLog whereTimestamp($value)
*
* @mixin \Eloquent
*/
class ActivityLog extends Model
@ -54,7 +56,7 @@ class ActivityLog extends Model
public const RESOURCE_NAME = 'activity_log';
/**
* Tracks all of the events we no longer wish to display to users. These are either legacy
* Tracks all the events we no longer wish to display to users. These are either legacy
* events or just events where we never ended up using the associated data.
*/
public const DISABLED_EVENTS = ['server:file.upload'];
@ -73,7 +75,7 @@ class ActivityLog extends Model
protected $with = ['subjects'];
public static $validationRules = [
public static array $validationRules = [
'event' => ['required', 'string'],
'batch' => ['nullable', 'uuid'],
'ip' => ['required', 'string'],
@ -91,7 +93,7 @@ class ActivityLog extends Model
return $morph;
}
public function subjects()
public function subjects(): HasMany
{
return $this->hasMany(ActivityLogSubject::class);
}