title: Pluck and Implode Method in Laravel?
body: <p>I have three classes Student, Session and student classes it has a relationship (Student with Enrollment, Session with Enrollment and student Class with enrollment), when I do echo it show the result
  [{&quot;id&quot;:1,&quot;school_id&quot;:1,&quot;class_id&quot;:1,&quot;student_id&quot;:1,&quot;session_id&quot;:1,&quot;created_at&quot;:null,&quot;updated_at&quot;:null}] ,i have plucked value from student class</p>
  <pre><code>{{implode(',',$en-&gt;school()-&gt;get()-&gt;pluck('school_name')-&gt;toArray())}}
  </code></pre>
  <p>Note it is working</p>
  <hr />
  <p>same from Session it is also working but when I plucked from student class and need class_name it not show an error but not the plucked value from studentclass here is the same type of query in blade.php</p>
  <pre><code>{{implode(',',$en-&gt;studentclass()-&gt;get()-&gt;pluck('class_name')-&gt;toArray())}}
  </code></pre>
  <hr />
  <p>here is the relationship one to many in StudentClass Controller</p>
  <pre><code>public function enrollments()
      {
          return $this-&gt;hasMany(Enrollement::class);
      }
  </code></pre>
  <p>Enrollement Class</p>
  <pre><code>public function studentclass()
      {
          return $this-&gt;belongsTo(StudentClass::class);
      }
  </code></pre>
  <p>how to pick the class_name value from table using this relationship. thanks</p>