<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Auth::routes([
  'register' => true, // Registration Routes...
  'reset' => false, // Password Reset Routes...
  'verify' => false, // Email Verification Routes...
]);

//store a push subscriber.
Route::post('/push','PushController@store');

Route::get('/dashboard', 'HomeController@index')->name('dashboard');

Route::get('/', 'Auth\LoginController@showLoginForm');

Route::get('/todo/backups', 'todoBackupController@index')->name('backups');

Route::post('/todo/backups/setstatus', 'todoBackupController@setstatus');

Route::post('/todo/backups/setassign', 'todoBackupController@setassign');

Route::get('/todo/backups/data', 'todoBackupController@fetchBackupData');

Route::get('/clienttasks', 'HomeController@clientTasks');

Route::post('/todo/backups/getcomments', 'todoBackupController@fetchEntryComments');

Route::post('/todo/backups/postcomment', 'todoBackupController@saveComment');

Route::group(['middleware' => 'is.admin'], function () {
    Route::get('/user/{data}', 'UserController@getData');
    Route::post('/user/{data}', 'UserController@postData');
});


require __DIR__ . '/profile.php';

require __DIR__ . '/admin.php';