Skip to content
pakainfo

Pakainfo

Web Development & Good Online education

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

validation Update User Profile in Laravel 5.7

February 10, 2019 Pakainfo Technology, jQuery, Laravel Leave a comment

Today, We want to share with you validation Update User Profile in Laravel 5.7.In this post we will show you Update User Profile Laravel 5.7, hear for Edit user profile best practice in laravel 5.7 we will give you demo and example for implement.In this post, we will learn about How to upload profile picture Avatar in Laravel 5.7 Authentication with an example.

Free Live Chat for Any Issue

validation Update User Profile in Laravel 5.7

Contents

  • validation Update User Profile in Laravel 5.7
    • Read
    • Summary
    • Related posts

There are the Following The simple About validation Update User Profile in Laravel 5.7 Full Information With Example and source code.

Also Read This πŸ‘‰   Get Laravel Route Parameters

As I will cover this Post with live Working example to develop Update Laravel 5.7 User Profiles, so the laravel 5.7 update user profile for this example is following below.

Upload profile picture Avatar in Laravel 5.7 Authentication

public function update(Request $request)
    {
 
        $user = Auth::user();
 
        $this->validate($request,[
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users,id,'.$user->id,
        ]);
 
        $user->name = $request->name;
        $user->email = $request->email;
 
        if($request->password){
 
            $this->validate($request,[
                'password' => 'min:6|confirmed',
            ]);
 
            $user->password = bcrypt($request->password);
        }
 
        if($request->hasFile('profileImg')){
 
            $this->validate($request,[
                'profileImg' =>  'mimes:png',
            ]);
            $profileImg = $request->file('profileImg');
            $uploadProfilename = time() . '.' . $profileImg->getClientOriginalExtension();
            Image::make($profileImg)->resize(300, 300)->save( public_path('/uploads/uploads/' . $uploadProfilename ) );
            $user->profileImg = $uploadProfilename;
        }
 
        $user->save();
 
        return view('home.profile', array('user' => Auth::user()));
    }

Handle Profile Picture Upload Request

    public function update(Request $request){

        $request->validate([
            'profile' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
        ]);

        $user = Auth::user();

        $profileName = $user->id.'_avatar'.time().'.'.request()->profile->getClientOriginalExtension();

        $request->profile->storeAs('avatars',$profileName);

        $user->profile = $profileName;
        $user->save();

        return back()
            ->with('success','You have successfully upload image.');

    }

Angular 6 CRUD Operations Application Tutorials

Read :

  • Technology
  • Google Adsense
  • Programming
Also Read This πŸ‘‰   Ajax PHP MySQL Creating Autocomplete Search Suggestion

Summary

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

I hope you get an idea about validation Update User Profile in Laravel 5.7.
I would like to have feedback on my Pakainfo.com 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.

Pakainfo
Pakainfo

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I’m a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Also Read This πŸ‘‰   Compare two dates using JavaScript

Related posts:

  1. User Profile Edit Script Update Script Laravel 7/6
  2. Laravel 5.6 Like Dislike rating system with jQuery, Ajax and PHP
  3. How to upload Profile Images to Users using Laravel 6?
  4. Multiple image slider in html source code
  5. How To Create Image Hover Overlay Effects?
  6. Laravel autocomplete typeahead search example
  7. Laravel 6 Insert Update and Delete record from MySQL
  8. laravel 6 Update Data in AJAX CRUD Operations
  9. How to Change User Password in Laravel 6
insert update delete in laravellaravel 5.7 update userlaravel 5.7 update user profilelaravel update bladelaravel update formlaravel update user passwordlaravel user profile tutorialupdate function in laravel

Post navigation

Previous Post:Laravel Dynamic active menu Example Tutorial
Next Post:VueJS Bar and Star Rating Component and demo

Search

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 (58) Ajax (464) AngularJS (377) ASP.NET (61) Bollywood (102) Codeigniter (175) CSS (98) Earn Money (61) Education (56) Entertainment (123) fullform (82) Google Adsense (62) Highcharts (77) Hollywood (103) JavaScript (1356) Jobs (40) jQuery (1422) Laravel (1087) LifeStyle (51) movierulz4 (57) Mysql (1029) Mysqli (890) Node.js (39) php (2117) Programming (2330) Python (96) ReactJS (37) Software (137) Software (83) Stories (94) tamilrockers (98) Tamilrockers kannada (58) Tamilrockers telugu (57) Tech (132) Technology (2378) Tips and Tricks (113) Tools (172) Top10 (394) Trading (69) Trending (63) VueJs (250) Web Technology (95) webtools (177) wordpress (166) World (214)

Advertise With Us

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

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
  • 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

Β© 2022 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 YouTube Tag Extractor