File: /home/dnlightw-124/dn.lightweb.kr/routes/orbit.php
<?php
use App\Http\Controllers\SocialLoginController;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Session;
Route::name('orbit.universal.')
->group(function (Router $router){
$router->get('/robots.txt',function(){
if(!siteConfigs('enable_robots_txt')) abort(404);
$defaultTxtPath = public_path('default_robots.txt');
$robotsTxt = siteConfigs('custom_robots_txt', file_get_contents($defaultTxtPath));
return response($robotsTxt,200)->header('Content-Type', 'text/plain');
});
});
Route::name('orbit.common.')
->prefix('/orbit-common')
->group(function (Router $router){
// Social Login
$router->get('/auth/{provider}/redirect',[SocialLoginController::class,"socialLiteRedirect"])
->name('social.redirect');
$router->get('/auth/{provider}/callback',[SocialLoginController::class,"socialLiteCallback"])
->name('social.callback');
// Language Switch
$router->get('/language-update/{language}', function ($language) {
session()->put('locale', $language);
return redirect()->to(Session::get('previous_url'));
})->name('language.update');
});