×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Iruka Avantha
Added: Nov 10, 2016 5:49 AM
Views: 3
Tags: no tags
  1.     /**
  2.      * @param $id
  3.      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|void
  4.      * @description displaying profile edit view to the logged in user
  5.      */
  6.     public function edit($id) {
  7.         if($this->userId == $id) {
  8.             //logged in users details
  9.             $userDetails = $this->getUserDetails($id);
  10.             $type = Auth::user()->type;
  11.             return view('profile.edit', compact('userDetails', 'type'));
  12.         } else {
  13.             return abort(403, 'Requested User Profile is not allowed to access');
  14.         }
  15.     }