Today, We want to share with you User Profile Edit Script, Update Script Laravel 7/6.In this post we will show you Saving/Updating User Profile in Laravel 5, hear for Laravel simple user edit account information we will give you demo and example for implement.In this post, we will learn about How to upload profile account information in Laravel 5 Authentication with an example.
User Profile Edit Script, Update Script Laravel 7/6
There are the Following The simple About User Profiles Edit Script, Update Script Laravel 7/6 Full Information With Example and source code.
As I will cover this Post with live Working example to develop Adding Laravel User Profiles, so the Saving/Updating User Profiles in Laravel 7/6 for this example is following below.
More Details for Pakainfo Blog:Free Download Example – Pakainfo.com
Create a view: users/edit.blade.php
@extends('layouts.app') @section('content')@endsectionEdit Profiles
Define a Laravel the routes:
Route::get('users/{user}', ['as' => 'users.edit', 'uses' => 'UserController@edit']); Route::patch('users/{user}/update', ['as' => 'users.update', 'uses' => 'UserController@update']);
Create a Laravel controller UserController
middleware('auth'); } public function edit(User $user) { $user = Auth::user(); return view('users.edit', compact('user')); } public function update(User $user) { if(Auth::user()->email == request('email')) { $this->validate(request(), [ 'name' => 'required', // 'email' => 'required|email|unique:users', 'password' => 'required|min:6|confirmed' ]); $user->name = request('name'); // $user->email = request('email'); $user->password = bcrypt(request('password')); $user->save(); return back(); } else{ $this->validate(request(), [ 'name' => 'required', //'email' => 'required|email|unique:users', 'email' => 'email|required|unique:users,email,'.$this->segment(2), 'password' => 'required|min:6|confirmed' ]); $user->name = request('name'); $user->email = request('email'); $user->password = bcrypt(request('password')); $user->save(); return back(); } } }
Pakainfo
Angular 6 CRUD Operations Application Tutorials
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about User Profiles Edit Script, Update Script Laravel 7/6.
I would like to have feedback on my Pakainfo blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.