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.
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
// Location of auth vendor/package .\php\www\website\vendor\leafs\auth\src
|
|
|
|
auth()->middleware('auth.required', function () {
|
|
response()->redirect('/auth/login');
|
|
});
|
|
|
|
auth()->middleware('auth.guest', function () {
|
|
response()->redirect('/dashboard');
|
|
});
|
|
|
|
app()->get('/auth', function(){
|
|
response()->redirect('/auth/login');
|
|
});
|
|
|
|
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');
|
|
});
|