This is a Laravel API Application for managing users and their wallets. Each wallet can have different types with specific attributes like minimum balance and monthly interest rate. The wallets can send and receive money from other wallets.
- Create multiple wallets.
- Manage wallet types.
- Perform transactions between wallets.
- PHP >= 8.1
- Composer
- MySQL
- Clone the repository:
git clone https://github.com/yourusername/walletapp.git cd walletapp - Install dependencies:
composer install
- Copy .env.example to .env and configure your database settings:
cp .env.example .env
- Generate application key:
php artisan key:generate
- Run migrations and seed the database:
php artisan migrate --seed
- Start the development server:
php artisan serve
- Method: GET
- URL: "/api/users"
- Method: GET
- URL: "/api/wallets"
- Method: GET
- URL: "/api/wallets/{id}"
- "id" (integer): The ID of the wallet.
- Method: POST
- URL: "/api/wallets/transfer"
- Body:
{ "sender_wallet_id": 2, "receiver_wallet_id": 4, "amount": 300 }
-
Get All Users:
- Method: GET
- URL: "http://127.0.0.1:8000/api/users"
-
Get All Wallets:
- Method: GET
- URL: "http://127.0.0.1:8000/api/wallets"
-
Get Wallet Details:
- Method: GET
- URL: http://127.0.0.1:8000/api/wallets/1
-
Send Money:
- Method: POST
- URL: http://127.0.0.1:8000/api/wallets/transfer
- Headers:
- Content-Type: application/json
- (Click on the 'Headers' tab under the url, then add 'Content-Type' for key, and 'application/json' for value)
- (Then click on the 'body' tab next to Headers, choose raw from the sub-tab and paste the code given below in the space provided. Make sure that JSON is selected from the drop down list at the righ hand side of the 'body' tab you clicked)
- Body:
{ "sender_wallet_id": 2, "receiver_wallet_id": 4, "amount": 300 }
Contributions are welcome! Please fork the repository and submit a pull request.
The Laravel framework is open-sourced software licensed under the MIT license.
