jcadima
8/22/2017 - 5:18 AM

web.php

web.php


<?php

/*
|--------------------------------------------------------------------------
| 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!
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function(){


	// ===================== PROJECTS ======================
	Route::get('/projects', 'ProjectController@index')->name('project.show') ;

	Route::get('/projects/create', 'ProjectController@create')->name('project.create') ;

	// Store the new project from the form posted with the view Above
	Route::post('/projects/store', 'ProjectController@store')->name('project.store');



	// ====================  TASKS =======================
	Route::get('/tasks','TaskController@index')->name('task.show') ;

	// Display the Create Task View form
	Route::get('/tasks/create', 'TaskController@create')->name('task.create'); 

	// Store the new task from the form posted with the view Above
	Route::post('/tasks/store', 'TaskController@store')->name('task.store');

	// Search view
	Route::get('/tasks/search', 'TaskController@searchTask')->name('task.search');

	// Sort Table
	Route::get('/tasks/sort/{key}', 'TaskController@sort')->name('task.sort') ;

	Route::get('/tasks/edit/{id}','TaskController@edit')->name('task.edit');
	Route::get('/tasks/list/{projectid}','TaskController@list')->name('task.list');
	Route::get('/tasks/delete/{id}', 'TaskController@destroy')->name('task.delete') ;
	Route::post('/tasks/update/{id}', 'TaskController@update')->name('task.update') ;
	Route::get('/tasks/completed/{id}','TaskController@completed')->name('task.completed');

	// ===================================================

});




Auth::routes();

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

// Route::get('/logout', 'ProjectController@logout');