datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
41 lines
1.2 KiB
<?php
|
|
// Routes using the web middleware
|
|
|
|
require "login.php";
|
|
|
|
Route::get('/about/terms', function () {
|
|
return view('about.terms');
|
|
});
|
|
|
|
Route::get('/about/privacy', function () {
|
|
return view('about.privacy');
|
|
});
|
|
|
|
Route::get('/', function () {
|
|
if (!Auth::guest()) {
|
|
return redirect(route('user.view', Auth::user()->name));
|
|
}
|
|
return view('welcome');
|
|
});
|
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
|
// Table resource
|
|
Route::group([
|
|
'prefix' => 'table',
|
|
], function () {
|
|
Route::get('create', 'TableController@create')->name('table.create');
|
|
Route::post('create', 'TableController@storeNew')->name('table.storeNew');
|
|
});
|
|
|
|
Route::group([
|
|
'prefix' => 'user',
|
|
], function () {
|
|
Route::get('edit', 'UserController@edit')->name('user.edit');
|
|
Route::post('edit', 'UserController@store')->name('user.store');
|
|
Route::post('create', 'TableController@storeNew')->name('table.storeNew');
|
|
});
|
|
});
|
|
|
|
// Table resource - located at the end to work as a fallback
|
|
Route::get('@{user}', 'UserController@view')->name('user.view');
|
|
Route::get('@{user}/{table}', 'TableController@view')->name('table.view');
|
|
|