Skip to content
pakainfo

Pakainfo

Web Development & Good Online education

  • Home
  • Blog
  • Categories
  • Tools
  • Full Form
  • Guest Post
    • Guest Posting Service
  • Advertise
  • About
  • Contact Us

User Profile Edit Script Update Script Laravel 7/6

April 10, 2020 Pakainfo Technology, Laravel, php, Programming Leave a comment

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

Contents

  • User Profile Edit Script, Update Script Laravel 7/6
    • Define a Laravel the routes
    • Read
    • Summary
    • Related posts

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')
<h3>Edit Profiles</h3>
<form method="post" action="{{route('users.update', $user)}}">
    {{ csrf_field() }}
    {{ method_field('patch') }}

    <input type="text" name="name"  value="{{ $user->name }}" />
    <input type="email" name="email"  value="{{ $user->email }}" />
    <input type="password" name="password" />
    <input type="password" name="password_confirmation" />

    <button type="submit">Send</button>
</form>
@endsection

Define a Laravel the routes:

Route::get('users/{user}',  ['as' => 'users.edit', 'uses' => 'User[email protected]']);
Route::patch('users/{user}/update',  ['as' => 'users.update', 'uses' => '[email protected]']);

Create a Laravel controller UserController
<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Auth;
use App\User;

class UserController extends Controller
{

    public function __construct()
    {
        $this->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 :

  • Technology
  • Google Adsense
  • Programming

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

Also Read This 👉   PHP retrieve_password wordpress function

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.

Related posts:

  1. How to Change User Password in Laravel 6
  2. CRUD Insert Edit Update Delete Node js with MYSQL
  3. How to upload Profile Images to Users using Laravel 6?
  4. laravel 6 Update Data in AJAX CRUD Operations
  5. Laravel Email Verification Script Example
  6. Laravel 6 Insert Update and Delete record from MySQL
edit user data in laravelhow to edit users in laravellaravel 5.4 update user profilelaravel 5.8 update user profilelaravel change user->emaillaravel edit user controllerlaravel user managementlaravel user profile tutorial

Post navigation

Previous Post:Passing data to views from routes in Laravel
Next Post:How to display image from storage path using route in Laravel?

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me

Categories

3movierulz (64) Ajax (464) AngularJS (377) ASP.NET (61) Bio (109) Bollywood (108) Codeigniter (175) CSS (98) Earn Money (94) Education (65) Entertainment (131) fullform (87) Google Adsense (64) Highcharts (77) History (40) Hollywood (109) JavaScript (1359) Jobs (43) jQuery (1423) Laravel (1088) LifeStyle (53) movierulz4 (63) Mysql (1035) Mysqli (894) php (2133) Programming (2346) Python (99) Software (197) Software (94) Stories (98) tamilrockers (104) Tamilrockers kannada (64) Tamilrockers telugu (61) Tech (149) Technology (2425) Tips and Tricks (130) Tools (215) Top10 (513) Trading (98) Trending (79) VueJs (250) Web Technology (116) webtools (201) wordpress (166) World (350)

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here
  • Home
  • About Us
  • Terms And Conditions
  • Write For Us
  • Advertise
  • Contact Us
  • Youtube Tag Extractor
  • Info Grepper
  • Guest Posting Sites
  • Increase Domain Authority
  • Social Media Marketing
  • Freelance web developer
  • Tools
Pakainfo 9-OLD, Ganesh Sco, Kothariya Ring Road, Chokadi, Rajkot - 360002 India
E-mail : [email protected]
Pakainfo

© 2023 Pakainfo. All rights reserved.

Top
Subscribe On YouTube : Download Source Code
We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype Guest Posting Sites