This project has been developed in Laravel Framework, below are the configuration and steps to execute the project. For more detailed steps check the Readme.doc file.
- Apache 2.4.29 (Win32) OpenSSL/1.0.2l PHP/7.1.11
- Laravel 5.5.33
- PHP 7.1.11
- MySQL 5.5
- Bootstrap 3.3.5
- JQuery 3.3.1
The project was developed in Windows 8.1 Operating System.
Step 1: Assumed the webserver is running and it supports above the stated configuration and other required configurations to run a Laravel project.
Step 2: Create a folder "laraveldatecmp" and Unzip the compressed project folder.
Say for example c:\xammp\htdocs\laraveldatecmp
Step 3: rename example.env to .env
Step 4: Run "composer install" to install the vendor files.
Step 5: If everything works fine then you should be able to access the project by accessing the url(assuming the webserver is local):
http://localhost/laraveldatecmp/public/questions
Step 6: Click the link "Answers" to redirect to a form page. Input the parameters for the questions and get the results.
-
composer global require "laravel/installer"
-
laravel new laraveldatecmp
-
composer install
-
rename .env.example to .env
-
Copy the controller and view folders from the github project extract and paste in the new instance.
5.1 Controllers: aligent/app/Http/Controllers/ Copy and paste the DateHelp.php and Question1Controller.php
5.2 Views: aligent/resources/views/ Copy and paste the "questions" folder.
The projects main controller files are located at aligent/app/Http/Controllers
-
DateHelper.php Helper class with date functions Usage: Given date range - start:$start_dateM and end date:$end_dateM.
1. Create object of the datehelper - with functions DateHelper: app/Http/Controllers/DateHelper.php $dFunc = new DateHelper(); 2. Date helper function to calculate the days in a given range $dFunc->getDaysFromDateRange($start_dateM,$end_dateM); 3. Date helper function to calculate the weekdays (excluding weekends) in a given range $dFunc->getWeekDaysFromDateRange($start_dateM,$end_dateM); 4. Date helper function to calculate the complete weeks $dFunc->getCompleteWeeksFromDateRange($start_dateM,$end_dateM,$detailed); -
Question1Controller.php Main controller to the landing and questions page. This controller calls the helper class for the functionality.
The projects view files are located at: aligent/resources/views/questions
- index.blade.php - laravel's default landing page - this page shows the challenge question page with a link to the form page.
- question1.blade.php - project's form page to accept parameters and return results.
👍