Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
584 changes: 584 additions & 0 deletions backend/AGENTS.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions backend/app/Http/Controllers/Account/Card/CardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ public function __construct(
) {
}

/**
* Wyświetla listę wszystkich kart płatniczych użytkownika.
*/
#[AuthorizeToken(['cards-view'], anyScope: true)]
#[QueryParameter('per_page', description: 'Ilość elementów na stronę.', type: 'int', default: 20, example: 30)]
#[QueryParameter('page', description: 'Numer obecnej strony.', type: 'int', default: 1, example: 2)]
public function allCards()
{
$userId = auth()->id();

$cards = Card::whereHas('account', function ($query) use ($userId) {
$query->where('user_id', $userId);
})->paginate(
perPage: $this->perPage(),
page: $this->currentPage(),
);

return CardResource::collection($cards);
}

/**
* Wyświetla listę kart płatniczych przypisanych do konta.
*/
Expand Down
Empty file modified backend/bootstrap/cache/.gitignore
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions backend/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
Route::get('accounts/balance', [AccountController::class, 'balance']);
Route::apiResource('accounts', AccountController::class);
Route::apiResource('accounts.cards', CardController::class)->only(['index', 'store']);
Route::get('cards', [CardController::class, 'allCards']);
Route::get('cards/{card}', [CardController::class, 'show']);
Route::patch('cards/{card}/block', [CardController::class, 'block']);
Route::patch('cards/{card}/unblock', [CardController::class, 'unblock']);
Expand Down
Empty file modified backend/storage/api-docs/api-docs.json
100644 → 100755
Empty file.
Empty file modified backend/storage/app/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/app/private/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/app/public/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/framework/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/framework/cache/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/framework/cache/data/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/framework/sessions/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/framework/testing/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/framework/views/.gitignore
100644 → 100755
Empty file.
Empty file modified backend/storage/logs/.gitignore
100644 → 100755
Empty file.
Loading
Loading