title: How to get Username from DB Based on Email posted in Laravel
body: <p>I have a function named check() and posted email/password to the check() function from a login form. I want to get the username from the database based on this email address. The function is inside my controller as I am using the Query builder method.</p>
  
  <pre><code>public function check(Request $request){
      $user = DB::Table('users')-&gt;where('email',$request['email'])-&gt;get();
      return $users-&gt;username;
  }
  </code></pre>