Browse Source

Update change password route

pull/46/head
Nafies Luthfi 6 years ago
parent
commit
e92c51f653
  1. 2
      resources/views/layouts/partials/nav.blade.php
  2. 2
      resources/views/users/change-password.blade.php
  3. 6
      routes/web.php

2
resources/views/layouts/partials/nav.blade.php

@ -40,7 +40,7 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li><a href="{{ route('backups.index') }}">{{ trans('backup.list') }}</a></li> <li><a href="{{ route('backups.index') }}">{{ trans('backup.list') }}</a></li>
<li><a href="{{ route('profile') }}">{{ trans('app.my_profile') }}</a></li> <li><a href="{{ route('profile') }}">{{ trans('app.my_profile') }}</a></li>
<li><a href="{{ route('profile.change-password.form') }}">{{ trans('auth.change_password') }}</a></li>
<li><a href="{{ route('password.change') }}">{{ trans('auth.change_password') }}</a></li>
<li> <li>
<a href="{{ route('logout') }}" <a href="{{ route('logout') }}"
onclick="event.preventDefault(); onclick="event.preventDefault();

2
resources/views/users/change-password.blade.php

@ -13,7 +13,7 @@
{{ session('success') ?: session('error')}} {{ session('success') ?: session('error')}}
</div> </div>
@endif @endif
<form class="form-horizontal" role="form" method="POST" action="{{ route('profile.change-password.update') }}">
<form class="form-horizontal" role="form" method="POST" action="{{ route('password.change') }}">
{{ csrf_field() }} {{ csrf_field() }}
<div class="form-group{{ $errors->has('old_password') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('old_password') ? ' has-error' : '' }}">
<label for="old_password" class="col-md-4 control-label">{{ trans('auth.old_password') }}</label> <label for="old_password" class="col-md-4 control-label">{{ trans('auth.old_password') }}</label>

6
routes/web.php

@ -15,8 +15,10 @@ Route::get('/', 'UsersController@search');
Auth::routes(); Auth::routes();
Route::get('profile/update-password', 'Auth\ChangePasswordController@show')->middleware('auth')->name('profile.change-password.form');
Route::post('profile/update-password', 'Auth\ChangePasswordController@update')->middleware('auth')->name('profile.change-password.update');
Route::group(['middleware' => 'auth'], function () {
Route::get('password/change', 'Auth\ChangePasswordController@show')->name('password.change');
Route::post('password/change', 'Auth\ChangePasswordController@update')->name('password.change');
});
Route::get('home', 'HomeController@index')->name('home'); Route::get('home', 'HomeController@index')->name('home');
Route::get('profile', 'HomeController@index')->name('profile'); Route::get('profile', 'HomeController@index')->name('profile');

Loading…
Cancel
Save