---
tags: [accounting, controller]
module: Accounting
---

# AccountController

## Connections
[[_Accounting]] · [[[Model]Account]] · [[[Service]AccountServices]] · [[[Repo]Repositories]] · [[[Job]Jobs]] · [[[Routes]Routes]]

## Source
```
Modules/Accounting/Http/Controllers/AccountController.php
Modules/Accounting/Http/Controllers/Api/AccountController.php
Modules/Accounting/Http/Controllers/GeneratingAccountCodeController.php
Modules/Accounting/Http/Controllers/ImportingAccountController.php
Modules/Accounting/Http/Controllers/UpdateBalanceThroughImportController.php
Modules/Accounting/Http/Controllers/Exporting/PDF/AccountController.php
Modules/Accounting/Http/Controllers/AccountJournalEntryController.php
```

## Web Controller Methods

| Method | Route | Permission |
|---|---|---|
| index | GET /accounts | accounting.chart-of-accounts.view |
| create | GET /accounts/create | accounting.chart-of-accounts.create |
| store | POST /accounts | accounting.chart-of-accounts.create |
| show | GET /accounts/{account} | accounting.chart-of-accounts.view |
| edit | GET /accounts/{account}/edit | accounting.chart-of-accounts.edit |
| update | PUT /accounts/{account} | accounting.chart-of-accounts.edit |
| destroy | DELETE /accounts/{account} | accounting.chart-of-accounts.delete |
| changeStatus | GET /accounts/{account}/change-status | accounting.chart-of-accounts.delete |
| suggestAccountCode | GET /accounts/suggest-account-code | — |
| listAccounts | GET /accounts/list-accounts | — |
| export | GET /accounts/export | accounting.chart-of-accounts.export |
| print | GET /accounts/print | accounting.chart-of-accounts.export |

## API Controller (v2)
- `GET/POST/PUT/DELETE /v2/accounting/accounts` — CRUD via API with Sanctum auth

## Key Service Dependencies
`ListingAccountsValidator` · `RetrievingAccountsService` · `PreparingDataForCreatingAccountService` · `CreatingNewAccountService` · `UpdatingAccountService` · `DeletingAccountService` · `ChangingAccountStatusService` · `GenerateAccountCodeService` · `ImportingAccountService` · `UpdatingBalanceThroughImportingService` · `PrintingPDFService`

## Job Dispatched
[[[Job]Jobs#FillOpeningClosingBalance]] — after store / update / destroy
