Create Scaffold with Laravel 5.7 — Profile (Part 3.2) Change password

Alfredo Barron
modulr
Published in
4 min readNov 1, 2018

--

In this part we will add to profile module the feature change password of Auth user.

Table of Contents

Add Routes

Into file routes/profile/profile.php add the next routes

<?php
Route::middleware('auth')->group(function () {
Route::group(['namespace' => 'Profile'], function() {
// view
Route::view('/profile', 'profile.profile');
Route::view('/password', 'profile.password');
// api
Route::group(['prefix' => 'api/profile'], function() {
Route::get('/getAuthUser',
'ProfileController@getAuthUser');
Route::put('/updateAuthUser',
'ProfileController@updateAuthUser');
Route::put('/updateAuthUserPassword',
'ProfileController@updateAuthUserPassword');

});
});
});

Update Controller

Into app/Http/Controllersr/Pofile/ProfileController.php file add the next code

<?phpnamespace App\Http\Controllers\Profile;

--

--