61 lines
2.2 KiB
PHP
61 lines
2.2 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Route;
|
||
|
use App\Models\Tenant;
|
||
|
|
||
|
/*
|
||
|
|--------------------------------------------------------------------------
|
||
|
| 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 () {
|
||
|
|
||
|
// dd(tenant());
|
||
|
return view('welcome');
|
||
|
});
|
||
|
Route::get('/buat_tenan', function () {
|
||
|
$tenant = Tenant::create([
|
||
|
'tenant_username'=>'dipta m',
|
||
|
'tenant_password'=>'1234'
|
||
|
]);
|
||
|
|
||
|
$tenant->domains()->create([
|
||
|
'domain' => 'ucms.localhost',
|
||
|
]);
|
||
|
});
|
||
|
|
||
|
Route::get('/hapus_tenan',function(){
|
||
|
$databaseName = tenant('tenancy_db_name');
|
||
|
|
||
|
Schema::getConnection()->getDoctrineSchemaManager()->dropDatabase("");
|
||
|
|
||
|
});
|
||
|
|
||
|
Auth::routes();
|
||
|
|
||
|
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||
|
// Auth::routes();
|
||
|
|
||
|
Route::get('/home', 'App\Http\Controllers\HomeController@index')->name('home');
|
||
|
|
||
|
Route::group(['middleware' => 'auth'], function () {
|
||
|
Route::resource('admin','App\Http\Controllers\AdminController');
|
||
|
Route::resource('node','App\Http\Controllers\NodeController');
|
||
|
Route::get('node/delete/{node}','App\Http\Controllers\NodeController@delete')->name('node.delete');
|
||
|
Route::resource('user', 'App\Http\Controllers\UserController', ['except' => ['show']]);
|
||
|
Route::get('profile', ['as' => 'profile.edit', 'uses' => 'App\Http\Controllers\ProfileController@edit']);
|
||
|
Route::put('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']);
|
||
|
Route::get('upgrade', function () {return view('pages.upgrade');})->name('upgrade');
|
||
|
Route::get('map', function () {return view('pages.maps');})->name('map');
|
||
|
Route::get('icons', function () {return view('pages.icons');})->name('icons');
|
||
|
Route::get('table-list', function () {return view('pages.tables');})->name('table');
|
||
|
Route::put('profile/password', ['as' => 'profile.password', 'uses' => 'App\Http\Controllers\ProfileController@password']);
|
||
|
});
|
||
|
|