diff --git a/README.md b/README.md index ef64b68b..f816a770 100644 --- a/README.md +++ b/README.md @@ -424,6 +424,9 @@ The following config options available: ### 6.7 URLs Here we have the url settings to setup the correct login/register link. Register here your dashboard, logout, login and register URLs. +- __`use_route_url`__ + + Whether to use `route()` instead of `url()`. - __`dashboard_url`__ Changes the dashboard/logo URL. @@ -440,6 +443,12 @@ Here we have the url settings to setup the correct login/register link. Register - __`register_url`__ Changes the register link or if set `false` it will hide. + - __`password_reset_url`__ + + Changes the password reset url. + - __`password_email_url`__ + + Changes the password email url. ### 6.8 Laravel Mix diff --git a/config/adminlte.php b/config/adminlte.php index fe036185..1a501072 100644 --- a/config/adminlte.php +++ b/config/adminlte.php @@ -132,6 +132,8 @@ | */ + 'use_route_url' => false, + 'dashboard_url' => 'home', 'logout_url' => 'logout', @@ -140,6 +142,10 @@ 'register_url' => 'register', + 'password_reset_url' => 'password/reset', + + 'password_email_url' => 'password/email', + /* |-------------------------------------------------------------------------- | Laravel Mix diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php index 39680e07..eeb125fc 100644 --- a/resources/views/login.blade.php +++ b/resources/views/login.blade.php @@ -7,15 +7,32 @@ @section('classes_body', 'login-page') +@php( $login_url = View::getSection('login_url') ?? config('adminlte.login_url', 'login') ) +@php( $register_url = View::getSection('register_url') ?? config('adminlte.register_url', 'register') ) +@php( $password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url', 'password/reset') ) +@php( $dashboard_url = View::getSection('dashboard_url') ?? config('adminlte.dashboard_url', 'home') ) + +@if (config('adminlte.use_route_url', false)) + @php( $login_url = $login_url ?? route($login_url) ) + @php( $register_url = $register_url ?? route($register_url) ) + @php( $password_reset_url = $password_reset_url ?? route($password_reset_url) ) + @php( $dashboard_url = $dashboard_url ?? route($dashboard_url) ) +@else + @php( $login_url = $login_url ?? url($login_url) ) + @php( $register_url = $register_url ?? url($register_url) ) + @php( $password_reset_url = $password_reset_url ?? url($password_reset_url) ) + @php( $dashboard_url = $dashboard_url ?? url($dashboard_url) ) +@endif + @section('body')
{{ __('adminlte::adminlte.login_message') }}
-- + {{ __('adminlte::adminlte.i_forgot_my_password') }}
- @if (config('adminlte.register_url', 'register')) + @if ($register_url)- + {{ __('adminlte::adminlte.register_a_new_membership') }}
diff --git a/resources/views/page.blade.php b/resources/views/page.blade.php index 270e8212..191215b4 100644 --- a/resources/views/page.blade.php +++ b/resources/views/page.blade.php @@ -41,18 +41,29 @@ @section('body_data', (config('adminlte.sidebar_scrollbar_theme', 'os-theme-light') != 'os-theme-light' ? 'data-scrollbar-theme=' . config('adminlte.sidebar_scrollbar_theme') : '') . ' ' . (config('adminlte.sidebar_scrollbar_auto_hide', 'l') != 'l' ? 'data-scrollbar-auto-hide=' . config('adminlte.sidebar_scrollbar_auto_hide') : '')) +@php( $logout_url = View::getSection('logout_url') ?? config('adminlte.logout_url', 'logout') ) +@php( $dashboard_url = View::getSection('dashboard_url') ?? config('adminlte.dashboard_url', 'home') ) + +@if (config('adminlte.use_route_url', false)) + @php( $logout_url = $logout_url ?? route($logout_url) ) + @php( $dashboard_url = $dashboard_url ?? route($dashboard_url) ) +@else + @php( $logout_url = $logout_url ?? url($logout_url) ) + @php( $dashboard_url = $dashboard_url ?? url($dashboard_url) ) +@endif + @section('body')