
# Mirgation to Laravel
For user authentication feature, Laravel framework is introduced into FMM to utilize its tools. Also the open source package of Syntara is used for its amdin panel. The documentation of Laravel can be found at 
https://laravel.com/docs/4.2. The documentation of Syntata can be found at https://github.com/MrJuliuss/syntara.

# Directory structure
The old directory structure of FMM UI is adjusted for Laravel. Basically all the php files of old UI are moved to app/php. The rest files are kept at public/packages/uifmm/
The public folder is the default document root of apache server.
Directories:
app/		application level files.
app/commands	console commands
app/config	configuration files
app/controllers	control files
app/database	database migration files
app/models	model files
app/php		php files of FMM
app/views	view files
app/views/index.blade.php       old index.html file
app/filters.php route fileters
app/routes.php	route

misc/		Several files about https

vendor/		
vendor/mrjuliuss/syntara
		Syntara package
Vendor/mrjuliuss/syntara/src
		main source of Syntara
vendor/cartalyst/sentry
		Sentry package. Syntara is based on it.

# install_ui.sh
A script for installation and reset. It calls laravel artisan commands to do database migration and other staff. The usage:
       install_ui.sh [install|reset|refresh].
'install' will write data to FMM table. It does not override the existing data. 'reset' clears the table data. 'refresh' does reset first and then install.

# route
The root of the routing schem is divided into /uifmm and /admin
/------uifmm/
|            |----sts/xxx
|            |----ops/yyy
|
 ------admin/
Where uifmm is for normal FMM operations and admin is for user management.

There are three roles defined for FMM: administrator, operator and viewer. 
The administrator has all the permissions.The operator can configure the FMM (set) while viewer can only have read permission (get).
 When add a new php file, need to determine if the php does set or get operation. For set, put the route as uifmm/ops/yyy; for get, put the route url as uifmm/sts/xxx.

# Notes
During installation, the web code of Syntara under vendor/mrjuliuss/syntara/public/assets will be published to public/packages/mrjuliuss/syntara/assets.
It will cause problem if you only change the code in public/packages/mrjuliuss/syntara/assets. You can make changes in the folder vendor/mrjuliuss/syntara/public/assets, and then do an asset publish
	php artisan asset:publish mrjuliuss/syntara


