PHP Classes

How to Implement a PHP Matrix Multiplication Service using the Package Matrix Multiplication: Provide matrix multiplication as a Web service

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-05-13 (4 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 20 All time: 11,289 This week: 60Up
Version License PHP version Categories
matrix-multiplicatio 1.0.0The PHP License7Web services, Math, PHP 7
Description 

Author

This package can provide matrix multiplication as a Web service.

It provides a service class that can take two matrices as parameters and calculate the multiplication between matrices.

The package provides the matrix multiplication as Web service.

Innovation Award
PHP Programming Innovation award nominee
May 2024
Number 6
Matrices are data elements that may contain numeric values stored in a grid like PHP arrays of two dimensions.

Matrix operations are used in many applications that process statistic values, such as image processing.

This package provides a matrix multiplication as a Web service with a REST API.

Manuel Lemos
Picture of Busari Ridwan
  Performance   Level  
Name: Busari Ridwan <contact>
Classes: 5 packages by
Country: Nigeria Nigeria
Age: ???
All time rank: 342824 in Nigeria Nigeria
Week rank: 200 Up6 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 4x

Documentation

Matrix Multiplication

Create a Laravel application for Matrix multiplication. The app should feature a REST API with authentication. For Matrix multiplication, the column count in the first matrix should be equal to the row count of the second matrix. If this condition is not met, the app should throw a validation error. The resulting matrix should contain characters rather than numbers, similar to excel columns. Examples: 1 => A, 26 => Z, 27 => AA, 28 => AB, etc.

Expectation

  • At least PHP 7.4 or 8.0 for coding (8.0 recommended).
  • PSR-2 coding standard.
  • Strict type hinting.
  • Tests.

How to run the application

Below are the steps you need to successfully setup and run the application.

  • Clone the app from the repository and cd into the root directory of the app
  • Run composer install
  • Copy .env.example into .env
  • Update DB credentials to match with your db
  • Run php artisan migrate to migrate database tables
  • Run php artisan db:seed to seed the default user record
  • Run php artisan jwt:secret to generate the key

API Endpoints

The api endpoint collection is extracted by importing this link Postman Collection on your postman.

Running Test

The test is setup to use the refresh database trait, please ensure you create a db for running the test and updating it on the .env. To run the test simply run /vendor/bin/phpunit

Login Access

The default login access are email : test@test.com and password : password

Enjoy!!!


  Files folder image Files (82)  
File Role Description
Files folder imageapp (7 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (15 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 server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files (82)  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 4 directories)
Files folder imageModels (1 file)
Files folder imageProviders (5 files)
Files folder imageRules (3 files)
Files folder imageServices (1 directory)

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

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

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

  Files folder image Files (82)  /  app  /  Http  /  Controllers  
File Role Description
Files folder imageApi (3 files)
  Plain text file Controller.php Class Class source

  Files folder image Files (82)  /  app  /  Http  /  Controllers  /  Api  
File Role Description
  Plain text file AuthController.php Class Class source
  Plain text file MatrixController.php Class Class source
  Plain text file MeController.php Class Class source

  Files folder image Files (82)  /  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 (82)  /  app  /  Http  /  Requests  
File Role Description
Files folder imageApi (2 directories)

  Files folder image Files (82)  /  app  /  Http  /  Requests  /  Api  
File Role Description
Files folder imageAuth (1 file)
Files folder imageMatrix (1 file)

  Files folder image Files (82)  /  app  /  Http  /  Requests  /  Api  /  Auth  
File Role Description
  Plain text file LoginRequest.php Class Class source

  Files folder image Files (82)  /  app  /  Http  /  Requests  /  Api  /  Matrix  
File Role Description
  Plain text file MatrixMultiplicationRequest.php Class Class source

  Files folder image Files (82)  /  app  /  Http  /  Resources  
File Role Description
Files folder imageApi (1 file)

  Files folder image Files (82)  /  app  /  Http  /  Resources  /  Api  
File Role Description
  Plain text file MeResource.php Class Class source

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

  Files folder image Files (82)  /  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 (82)  /  app  /  Rules  
File Role Description
  Plain text file FullMatrixRule.php Class Class source
  Plain text file MatrixIntegerRule.php Class Class source
  Plain text file MatrixRangeRule.php Class Class source

  Files folder image Files (82)  /  app  /  Services  
File Role Description
Files folder imageApi (1 directory)

  Files folder image Files (82)  /  app  /  Services  /  Api  
File Role Description
Files folder imageMatrix (1 file)

  Files folder image Files (82)  /  app  /  Services  /  Api  /  Matrix  
File Role Description
  Plain text file MultiplicationService.php Class Class source

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

  Files folder image Files (82)  /  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 filesystems.php Aux. Auxiliary script
  Accessible without login Plain text file hashing.php Aux. Auxiliary script
  Plain text file jwt.php Class Class source
  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
  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 (82)  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (3 files)
Files folder imageseeders (2 files)

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

  Files folder image Files (82)  /  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

  Files folder image Files (82)  /  database  /  seeders  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source
  Plain text file UsersTableSeeder.php Class Class source

  Files folder image Files (82)  /  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 (82)  /  resources  
File Role Description
Files folder imagejs (2 files)
Files folder imagelang (1 directory)
Files folder imageviews (1 file)

  Files folder image Files (82)  /  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 (82)  /  resources  /  lang  
File Role Description
Files folder imageen (4 files)

  Files folder image Files (82)  /  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 (82)  /  resources  /  views  
File Role Description
  Accessible without login Plain text file welcome.blade.php Aux. Auxiliary script

  Files folder image Files (82)  /  routes  
File Role Description
  Accessible without login Plain text file api.php Aux. Auxiliary script
  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 (82)  /  tests  
File Role Description
Files folder imageFeature (1 directory)
Files folder imageUnit (1 directory)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files (82)  /  tests  /  Feature  
File Role Description
Files folder imageApi (3 directories)

  Files folder image Files (82)  /  tests  /  Feature  /  Api  
File Role Description
Files folder imageAuthentication (1 file)
Files folder imageMatrix (1 file)
Files folder imageMe (1 file)

  Files folder image Files (82)  /  tests  /  Feature  /  Api  /  Authentication  
File Role Description
  Plain text file LoginTest.php Class Class source

  Files folder image Files (82)  /  tests  /  Feature  /  Api  /  Matrix  
File Role Description
  Plain text file MatrixMultiplicationTest.php Class Class source

  Files folder image Files (82)  /  tests  /  Feature  /  Api  /  Me  
File Role Description
  Plain text file MeTest.php Class Class source

  Files folder image Files (82)  /  tests  /  Unit  
File Role Description
Files folder imageApi (1 directory)

  Files folder image Files (82)  /  tests  /  Unit  /  Api  
File Role Description
Files folder imageModels (1 file)

  Files folder image Files (82)  /  tests  /  Unit  /  Api  /  Models  
File Role Description
  Plain text file UserTest.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:20
This week:0
All time:11,289
This week:60Up