45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
|
|
use App\Models\Chatbot;
|
|
use App\Livewire\Auth\Login;
|
|
use App\Livewire\Auth\Register;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
// Guest routes
|
|
Route::middleware('guest')->group(function () {
|
|
Route::get('/login', Login::class)->name('login');
|
|
Route::get('/register', Register::class)->name('register');
|
|
});
|
|
|
|
// Logout route
|
|
Route::any('/logout', function () {
|
|
Auth::logout();
|
|
request()->session()->invalidate();
|
|
request()->session()->regenerateToken();
|
|
return redirect('/login');
|
|
})->name('logout');
|
|
|
|
// Authenticated administration routes
|
|
Route::middleware('auth')->group(function () {
|
|
// Global console / Chatbot manager
|
|
Route::get('/', function () {
|
|
return view('welcome');
|
|
});
|
|
|
|
// Admin dashboard for a specific chatbot
|
|
Route::get('/admin/chatbots/{chatbot:slug}', function (Chatbot $chatbot) {
|
|
return view('chatbot-admin', compact('chatbot'));
|
|
});
|
|
});
|
|
|
|
// Full page demo testing for a specific chatbot (Public/Private as per requirement)
|
|
Route::get('/chatbot/{chatbot:slug}', function (Chatbot $chatbot) {
|
|
return view('chatbot-demo', compact('chatbot'));
|
|
});
|
|
|
|
// Iframe widget frame for a specific chatbot
|
|
Route::get('/chatbot-widget/{chatbot:slug}', function (Chatbot $chatbot) {
|
|
return view('chatbot-widget-frame', compact('chatbot'));
|
|
});
|