<?php

use App\Http\Controllers\page1Controller;
use App\Http\Controllers\page2Controller;
use App\Http\Controllers\page3Controller;
use App\Http\Controllers\page4Controller;
use App\Http\Controllers\page5Controller;
use App\Http\Controllers\page6Controller;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::middleware('track-visits')->get('/', function () {
    return view('welcome');
})->name('home');

//Auth::routes();

Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])->name('dashboard');

Route::middleware('auth')->group(function () {
    Route::view('about', 'about')->name('about');

    Route::get('users', [\App\Http\Controllers\UserController::class, 'index'])->name('users.index');

    Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])->name('profile.show');
    Route::put('profile', [\App\Http\Controllers\ProfileController::class, 'update'])->name('profile.update');
});

Route::redirect('/login', '/admin/login');

Route::view('offline', 'offline')->name('offline');

Route::get('artisan/optimize:clear', function (){
    \Artisan::call('optimize:clear');
    dump(\Artisan::output());
});

Route::get('artisan/optimize', function (){
    \Artisan::call('optimize');
    dump(\Artisan::output());
});

Route::get('artisan/migrate', function () {
    \Artisan::call('migrate');
    dump(\Artisan::output());
});


Route::get('artisan/storage:link', function () {
    \Artisan::call('storage:link --force');
    dump(\Artisan::output());
});
