Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -36,25 +36,28 @@ use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class AuditLogEntry
*
* @property-read Model|Eloquent $auditable
* @property-read Model|Eloquent $changer
* @method static Builder|AuditLogEntry newModelQuery()
* @method static Builder|AuditLogEntry newQuery()
* @property \Eloquent|Model $auditable
* @property \Eloquent|Model $changer
*
* @method static Builder|AuditLogEntry newModelQuery()
* @method static Builder|AuditLogEntry newQuery()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry onlyTrashed()
* @method static Builder|AuditLogEntry query()
* @method static Builder|AuditLogEntry query()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withTrashed()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withoutTrashed()
* @property int $id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Carbon|null $deleted_at
* @property int $auditable_id
* @property string $auditable_type
* @property int $changer_id
* @property string $changer_type
* @property string $action
* @property array|null $before
* @property array|null $after
*
* @property int $id
* @property null|Carbon $created_at
* @property null|Carbon $updated_at
* @property null|Carbon $deleted_at
* @property int $auditable_id
* @property string $auditable_type
* @property int $changer_id
* @property string $changer_type
* @property string $action
* @property null|array $before
* @property null|array $after
*
* @method static Builder|AuditLogEntry whereAction($value)
* @method static Builder|AuditLogEntry whereAfter($value)
* @method static Builder|AuditLogEntry whereAuditableId($value)
@@ -66,6 +69,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static Builder|AuditLogEntry whereDeletedAt($value)
* @method static Builder|AuditLogEntry whereId($value)
* @method static Builder|AuditLogEntry whereUpdatedAt($value)
*
* @mixin Eloquent
*/
class AuditLogEntry extends Model
@@ -82,39 +86,27 @@ class AuditLogEntry extends Model
'deleted_at' => 'datetime',
];
/**
*/
public function auditable(): MorphTo
{
return $this->morphTo();
}
/**
*/
public function changer(): MorphTo
{
return $this->morphTo();
}
/**
* @return Attribute
*/
protected function auditableId(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
get: static fn ($value) => (int)$value,
);
}
/**
* @return Attribute
*/
protected function changerId(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
get: static fn ($value) => (int)$value,
);
}
}