You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aNetwork-leaf/app/routes/_auth.php

37 lines
975 B
PHP

<?php
auth()->middleware('auth.required', function () {
response()->redirect('/auth/login');
});
auth()->middleware('auth.guest', function () {
response()->redirect('/dashboard');
});
app()->group('/auth', [
'middleware' => 'auth.guest',
function () {
app()->get('/login', 'Auth\LoginController@show');
app()->post('/login', 'Auth\LoginController@store');
app()->get('/register', 'Auth\RegisterController@show');
app()->post('/register', 'Auth\RegisterController@store');
},
]);
app()->post('/auth/logout', [
'middleware' => 'auth.required',
'Auth\LoginController@logout'
]);
app()->group('/dashboard', [
'middleware' => 'auth.required',
function () {
app()->get('/', 'Auth\DashboardController@index');
},
]);
app()->group('/settings', function () {
app()->get('/profile', 'Profile\AccountController@show_update');
app()->patch('/profile', 'Profile\AccountController@update');
});