PHP Classes

ICT PHP Expenses Management: API to manage records of expenses of users

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 26 All time: 11,193 This week: 455Up
Version License PHP version Categories
expenses-management 1.0Shareware5PHP 5, Web services, Finances
Description 

Author

This package provides an API to manage records of expenses of users.

It can handle requests to several API endpoint URLs to perform operations with financial expansions done by application users. Currently, it can:

- Record new expenses
- Return the list of previously recorded expenses

Picture of Ahmad Mustapha
Name: Ahmad Mustapha <contact>
Classes: 24 packages by
Country: Nigeria Nigeria
Age: ???
All time rank: 226511 in Nigeria Nigeria
Week rank: 164 Up7 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 9x

Details

ITC Expenses Management

Installation

The installation of this project requires composer

  • Step 1: Clone this repository
    git clone git@github.com:ahmard/ict-expenses-management.git
    
  • Step 2: Change directory ownership
    chown www-data:www-data ict-expenses-management -R
    
  • Step 3: Install composer dependencies
    cd ict-expenses-management
    composer update
    
  • Step 4: Configure database connection, duplicate .env.example to .env and make following changes to .env * DB_DATABASE = your_database_name * DB_USERNAME = your_database_user * DB_PASSWORD = your_database_user_password
  • Step 5: Generate application key
    php artisan key:generate
    
  • Step 6: copy config/dev.conf to /etc/nginx/conf.d/dev.conf to configure nginx
  • Step 7: Restart nginx
    service nginx restart
    

You can alternatively use PHP's built-in server

cd ict-expenses-management
php artisan serve

And all your requests should be sent to http://localhost:8000

Usage

List expenses

Send GET request to /api/expenses endpoint

Create expenses

Send POST request to /api/expenses endpoint with following json-payload

{
    "user": 1,
    "reason" : "Your expense reason",
    "value": "Your expense value",
    "date": "YYYY-MM-DD"
}

If your expense is created, you'll receive something like

{
    "success": true,
    "status": 200,
    "data": {
        "user": 1,
        "reason": "Fri",
        "value": 2384,
        "date": "2021-08-19",
        "updated_at": "2021-08-19T11:44:27.000000Z",
        "created_at": "2021-08-19T11:44:27.000000Z",
        "expense_id": 8
    }
}

In case of any validation error, you'll receive response similar to below

{
    "success": false,
    "status": 500,
    "data": {
        "reason": [
            "The reason must be at least 3 characters."
        ]
    }
}

Testing the application

php artisan test

  Files folder image Files (80)  
File Role Description
Files folder imageapp (1 file, 5 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (16 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (4 files)
Files folder imageresources (3 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file requests.http Data Auxiliary data
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files (80)  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 3 directories)
Files folder imageModels (2 files)
Files folder imageProviders (5 files)
  Plain text file JsonResponseDecorator.php Class Class source

  Files folder image Files (80)  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files (80)  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files (80)  /  app  /  Http  
File Role Description
Files folder imageControllers (2 files)
Files folder imageMiddleware (8 files)
Files folder imageResources (1 file)
  Plain text file Kernel.php Class Class source

  Files folder image Files (80)  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file Controller.php Class Class source
  Plain text file ExpensesController.php Class Class source

  Files folder image Files (80)  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file EncryptCookies.php Class Class source
  Plain text file PreventRequestsDuringMaintenance.php Class Class source
  Plain text file RedirectIfAuthenticated.php Class Class source
  Plain text file TrimStrings.php Class Class source
  Plain text file TrustHosts.php Class Class source
  Plain text file TrustProxies.php Class Class source
  Plain text file VerifyCsrfToken.php Class Class source

  Files folder image Files (80)  /  app  /  Http  /  Resources  
File Role Description
  Plain text file Expenses.php Class Class source

  Files folder image Files (80)  /  app  /  Models  
File Role Description
  Plain text file Expense.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files (80)  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file BroadcastServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source
  Plain text file RouteServiceProvider.php Class Class source

  Files folder image Files (80)  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files (80)  /  config  
File Role Description
  Plain text file app.php Class Class source
  Plain text file auth.php Class Class source
  Accessible without login Plain text file broadcasting.php Aux. Auxiliary script
  Accessible without login Plain text file cache.php Aux. Auxiliary script
  Accessible without login Plain text file cors.php Aux. Auxiliary script
  Accessible without login Plain text file database.php Aux. Auxiliary script
  Accessible without login Plain text file dev.conf Data Auxiliary data
  Accessible without login Plain text file filesystems.php Aux. Auxiliary script
  Accessible without login Plain text file hashing.php Aux. Auxiliary script
  Plain text file logging.php Class Class source
  Accessible without login Plain text file mail.php Aux. Auxiliary script
  Accessible without login Plain text file queue.php Aux. Auxiliary script
  Plain text file sanctum.php Class Class source
  Accessible without login Plain text file services.php Aux. Auxiliary script
  Accessible without login Plain text file session.php Aux. Auxiliary script
  Accessible without login Plain text file view.php Aux. Auxiliary script

  Files folder image Files (80)  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (5 files)
Files folder imageseeders (3 files)

  Files folder image Files (80)  /  database  /  factories  
File Role Description
  Plain text file UserFactory.php Class Class source

  Files folder image Files (80)  /  database  /  migrations  
File Role Description
  Plain text file 2014_10_12_000000_create_users_table.php Class Class source
  Plain text file 2014_10_12_100000_...rd_resets_table.php Class Class source
  Plain text file 2019_08_19_000000_...iled_jobs_table.php Class Class source
  Plain text file 2019_12_14_000001_...ss_tokens_table.php Class Class source
  Plain text file 2021_08_19_103631_..._expenses_table.php Class Class source

  Files folder image Files (80)  /  database  /  seeders  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source
  Plain text file ExpenseSeeder.php Class Class source
  Plain text file UserSeeder.php Class Class source

  Files folder image Files (80)  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source
  Accessible without login Plain text file robots.txt Doc. Documentation
  Accessible without login Plain text file web.config Data Auxiliary data

  Files folder image Files (80)  /  resources  
File Role Description
Files folder imagejs (2 files)
Files folder imagelang (1 directory)
Files folder imageviews (1 file)

  Files folder image Files (80)  /  resources  /  js  
File Role Description
  Accessible without login Plain text file app.js Data Auxiliary data
  Accessible without login Plain text file bootstrap.js Data Auxiliary data

  Files folder image Files (80)  /  resources  /  lang  
File Role Description
Files folder imageen (4 files)

  Files folder image Files (80)  /  resources  /  lang  /  en  
File Role Description
  Accessible without login Plain text file auth.php Aux. Auxiliary script
  Accessible without login Plain text file pagination.php Aux. Auxiliary script
  Accessible without login Plain text file passwords.php Aux. Auxiliary script
  Accessible without login Plain text file validation.php Aux. Auxiliary script

  Files folder image Files (80)  /  resources  /  views  
File Role Description
  Accessible without login Plain text file welcome.blade.php Aux. Auxiliary script

  Files folder image Files (80)  /  routes  
File Role Description
  Plain text file api.php Class Class source
  Accessible without login Plain text file channels.php Example Example script
  Accessible without login Plain text file console.php Example Example script
  Accessible without login Plain text file web.php Aux. Auxiliary script

  Files folder image Files (80)  /  tests  
File Role Description
Files folder imageFeature (2 files)
Files folder imageUnit (1 file)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files (80)  /  tests  /  Feature  
File Role Description
  Plain text file ExampleTest.php Class Class source
  Plain text file ExpensesEndpointTest.php Class Class source

  Files folder image Files (80)  /  tests  /  Unit  
File Role Description
  Plain text file ExampleTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:26
This week:0
All time:11,193
This week:455Up