Skip to content

Commit

Permalink
Lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
ok200lyndon authored and github-actions[bot] committed Aug 15, 2024
1 parent f527ca9 commit 4caf538
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function handle()
$vouchers = Voucher::factory(100)->createQuietly();
$voucherSets = VoucherSet::factory(100)->createQuietly();
$auditItems = AuditItem::factory(100)->createQuietly([
'team_id' => 1
'team_id' => 1,
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ApiAdminAuditItemsController extends Controller
* Set the related data the GET request is allowed to ask for
*/
public array $availableRelations = [
'team'
'team',
];

public static array $searchableFields = [];
Expand Down
3 changes: 1 addition & 2 deletions app/Models/AuditItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\MorphTo;

class AuditItem extends Model
Expand All @@ -19,6 +18,6 @@ public function auditable(): MorphTo

public function team(): BelongsTo
{
return $this->belongsTo( Team::class, 'team_id', 'id');
return $this->belongsTo(Team::class, 'team_id', 'id');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
return new class() extends Migration
{
/**
* Run the migrations.
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/API/App/AuditItems/AuditItemsDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Enums\ApiResponse;
use App\Enums\PersonalAccessTokenAbility;
use App\Models\AuditItem;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker;
use Laravel\Sanctum\Sanctum;
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Models/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ public function testAuditItemsRelation(): void

AuditItem::factory($num)->create([
'auditable_type' => User::class,
'auditable_id' => $user->id,
'auditable_id' => $user->id,
]);

// Same ID but different class, should NOT be returned
AuditItem::factory($num)->create([
'auditable_type' => Team::class,
'auditable_id' => $user->id,
'auditable_id' => $user->id,
]);

// Same class but different ID, should NOT be returned
AuditItem::factory($num)->create([
'auditable_type' => User::class,
'auditable_id' => $user->id + 1,
'auditable_id' => $user->id + 1,
]);

$userWithAuditItems = User::with('auditItems')->find($user->id);
Expand Down

0 comments on commit 4caf538

Please sign in to comment.