- IMEI validation checks in App\Classes\Imei
- Luhn Algorithm Checksum validation check in App\Classes\Checksum (extracted from main IMEI class to DRY up code)
- Download repository from Github
- Add .env file to project root - provided via email
- Run
composer install
in project root - Run
php artisan serve
in project root (Unix systems) - In browser, navigate to local web address (e.g. http://127.0.0.1:8000)
- Enter desired IMEI number(s) into form & submit
- If valid, a results page will display the IMEI number parsed
- If invalid, an error page will be displayed with issue flagged
- Validation requirement: string must not be empty
- Validation requirement: 15 digits in length -> Invalid length
- Validation requirement: numeric input -> Invalid type: non-numeric
- Validation requirement: Luhn algorithm checksum -> Invalid checksum
- Run
php aritsan test
in project root to run automated tests- Test cases can be found in: Tests\Feature\ImeiTest
- success - a successful form submission
- fail length - incorrect string length
- fail numeric - string is a non-numeric
- fail checksum - string fails Luhn checksum
- fail empty - string is empty
- Test cases can be found in: Tests\Feature\ImeiTest
- Created with a standard vanilla Laravel PHP application
- Running code from Unix system (built locally on Mac, deployed on Ubuntu)
- Used Laravel Valet for local development
- PHP Version: 8.1
- Database: N/A
- Other services: N/A
- Developers can utilize this app/library in several different ways:
- On demand web tool to validate IMEI numbers
- Predefined rules to confirm IMEI validity before usage
- Code is extracted into two main classes for validation: IMEI & Checksum (Luhn Algorithm)
- These two classes can be built upon further, extended, etc. for more complex operations, process, etc.
- Desired tool should be built into web application
- Did not want applicant to add additional development time for initial build out of independent Composer package and then integrate into web app
- Did not want applicant to implement Form Request helpers for basic validation (string length, numeric)
- Extract IMEI and Checksum data further into independent PHP Composer package
- Add API wrapper functionality and JSON handling for possible microservice
- Protect tool(s) with some basic form of authentication
- Add SSL certificates to demo site (e.g. Let's Encrypt)
- Add standardized Code Sniffing, Style Enforcement, and tests runners into automated Github Actions