#Php Route '/' and '/index'

2 messages · Page 1 of 1 (latest)

neon monolith
#
<?php

use App\Http\Controllers\IndexController;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

Route::get('/', [IndexController::class, 'index'])->name('index');

Route::get('/uuu', function () {
    return view('aauu');
});

require __DIR__ . '/auth.php';

Auth::routes();


<?php

namespace App\Http\Controllers;

class IndexController extends Controller
{

    public function index()
    {
        return view('index');
    }
}

What should I do extra so that '/' and '/index' redirect to the same location?

uncut narwhal
#

read docs, there is route:redirect or something like that