<?php

use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return Redirect()->route('login');
});

Auth::routes();

Route::middleware(['auth','branch']) ->group(function () {

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

// Profile
Route::prefix('profile')->name('profile.')->group(function () {
    Route::get('/',          [App\Http\Controllers\ProfileController::class, 'edit'])->name('edit');
    Route::post('/info',     [App\Http\Controllers\ProfileController::class, 'updateInfo'])->name('update-info');
    Route::post('/password', [App\Http\Controllers\ProfileController::class, 'updatePassword'])->name('update-password');
    Route::post('/avatar',   [App\Http\Controllers\ProfileController::class, 'updateAvatar'])->name('update-avatar');
});

});