title: How to update email value in laravel
body: <p>We know that laravel has an update () method that updates records using the http "put" method. But I do not know how to create an edpoint in which I will be able to modify the email. </p>
  
  <p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\User;
  
  class UserController extends Controller
  {
  
      public function index()
      {
          return response()-&gt;json([
              'name' =&gt; 'Abigail',
              'state' =&gt; 'CA'
          ]);
      }
  
  
      public function store(Request $request)
      {
          $user = new User();
          $user-&gt;name = $request-&gt;get("name");
          $user-&gt;email = $request-&gt;get("email");
          $user-&gt;password = $request-&gt;get("password");
          $user-&gt;save();
          return response()-&gt;json($user-&gt;toArray(), 200);
      }
  
  
  
      public function show($id)
      {
          //
      }
  
  
      public function edit($id)
      {
          //
      }
  
  
      public function update(Request $request, $id)
      {
          //
      }
  
  
      public function destroy($id)
      {
          //
      }
  }
  </code></pre>
  
  <p>And my route:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Http\Request;
  
  Route::middleware('auth:api')-&gt;get('/user', function (Request $request) {
      return $request-&gt;user();
  });
  
  Route::post('v1/users/create', 'UserController@store');
  </code></pre>
  
  <p>RESTful APIs made by me tests in Postman. Help me somebody</p>