title: How to pluck multiple columns in Laravel
body: <p>I want to get a student's full name, but in my database, I have two different columns: <code>first_name</code> and <code>last_name.</code> I want to get both of these columns at the same time.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function getStudentName($id) 
  {
      $students = DB::table("students")-&gt;where("students_class_id", $id)
          -&gt;pluck("first_name", "id");
  
      return json_encode($students);
  }
  </code></pre>