
UNHLS Inventory Management System
=====

Requirements
------------
1. Supported database. Currently only MySQL has been tested. Laravel also supports PostgreSQL, SQLite and SQL Server. Follow this link to download MYSQL
2. Download PHP from [here](http://php.net) version 5.4 and greater.
3. Download Composer from [here](https://getcomposer.org) a Dependency manager for PHP.

Installation

  ##### FROM SOURCE

1. Extract this git repository to a local folder
    git clone https://BenByron23@bitbucket.org/uhlsims/unhlsims.git   
3. Change directory to the root folder of the application. Update **composer** then run it in order to install the application dependencies. You may need root permissions to update composer.
      composer self-update<br />
      composer install

4. Update the application configuration files to suit your local settings:
  - Set the "Application URL" in `/app/config/app.php`
  - Create a database and set the database connection details in `/app/config/database.php`
  - The organization name in `/app/config/kblis.php`

5. Run the migrations to create the required database tables.
    php artisan migrate
6. Load the basic seed data
    php artisan db:seed
    After seeding, please import the countries.csv file into your mysql table called countries
   If #5 or #6 above fails, you may need to run the following command then repeat the two commands again.
   LOAD DATA LOCAL INFILE '/var/www/html/unhlsims/countries.csv' INTO TABLE countries FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

     composer dumpautoload
7. If you are running the application on a webserver eg. apache, ensure that the webserver has write permissions to the /app/storage folder.
   Ideally the web-root should be the /public folder.
   The default login credentials are '*administrator*' '*password*'.

Troubleshooting
----------------
Ensure that you enable mod_rewrite, `sudo a2enmod rewrite` if you are using apache. This should solve the problem of routing failures.
