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.
 
 
 
 
 
 
datatable.directory/routes/web.php

64 lines
2.1 KiB

<?php
// Routes using the web middleware
require "login.php";
Route::get('/ping', function () {
die(
json_encode([
'user_agent' => request()->userAgent(),
'ip' => request()->ip(),
'server_time' => date('r'),
], 128)
);
});
Route::get('/about/terms', function () {
return view('about.terms');
})->name('terms');
Route::get('/about/privacy', function () {
return view('about.privacy');
})->name('privacy');
Route::get('/', 'DashController@view')->name('dash');
// redirect home to user home
Route::get('/home', function () {
if (guest()) return redirect('/');
return redirect(route('profile.view', user()->name));
})->name('home');
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' => 'profile',
], function () {
Route::get('edit', 'ProfileController@editProfile')->name('profile.edit');
Route::post('store', 'ProfileController@storeProfile')->name('profile.store');
});
Route::group([
'prefix' => 'account',
], function () {
Route::get('edit', 'AccountController@editAccount')->name('account.edit');
Route::post('store', 'AccountController@storeAccount')->name('account.store');
Route::get('forget-social-login/{id}', 'AccountController@forgetSocialLogin')->name('forget-identity');
});
Route::get('@{user}/{table}/settings', 'TableController@settings')->name('table.conf');
Route::post('@{user}/{table}/settings', 'TableController@storeSettings')->name('table.storeConf');
Route::post('@{user}/{table}/delete', 'TableController@delete')->name('table.delete');
});
// Table resource - located at the end to work as a fallback
Route::get('@{user}', 'ProfileController@view')->name('profile.view');
Route::get('@{user}/{table}', 'TableController@view')->name('table.view');