Various code cleanup.

This commit is contained in:
James Cole
2023-11-05 19:41:37 +01:00
parent a0564751d6
commit 1d2e95f5af
136 changed files with 1171 additions and 514 deletions

View File

@@ -33,15 +33,15 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Carbon\Carbon;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
/**
* FireflyIII\Models\WebhookMessage
*
* @property int|string $id
* @property int $id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $deleted_at
* @property int|string $webhook_id
* @property int $webhook_id
* @property bool $sent
* @property bool $errored
* @property int $attempts
@@ -69,6 +69,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class WebhookMessage extends Model
{
use ReturnsIntegerIdTrait;
protected $casts
= [
'sent' => 'boolean',
@@ -128,4 +130,14 @@ class WebhookMessage extends Model
get: static fn ($value) => (bool)$value,
);
}
/**
* @return Attribute
*/
protected function webhookId(): Attribute
{
return Attribute::make(
get: static fn($value) => (int)$value,
);
}
}