Skip to content

Commit

Permalink
style: Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmellor committed Mar 17, 2024
1 parent f21ba58 commit 445034d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::table('approvals', function (Blueprint $table) {
Expand Down
6 changes: 3 additions & 3 deletions src/Concerns/MustBeApproved.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ trait MustBeApproved

public static function bootMustBeApproved(): void
{
static::creating(callback: fn($model): ?bool => static::insertApprovalRequest($model));
static::updating(callback: fn($model): ?bool => static::insertApprovalRequest($model));
static::creating(callback: fn ($model): ?bool => static::insertApprovalRequest($model));
static::updating(callback: fn ($model): ?bool => static::insertApprovalRequest($model));
}

/**
Expand All @@ -26,7 +26,7 @@ protected static function insertApprovalRequest($model): ?bool
$foreignKeyValue = $filteredDirty[$foreignKey] ?? null;

// Remove the foreign key from the dirty attributes
unset($filteredDirty[$foreignKey]);
unset($filteredDirty[$foreignKey]);

foreach ($filteredDirty as $key => $value) {
if (isset($model->casts[$key]) && $model->casts[$key] === 'json') {
Expand Down

0 comments on commit 445034d

Please sign in to comment.