title: How to retrieve data with zeros in eloquent
body: <p>I am creating a student number from retrieving multiple data from database. </p>
  
  <p>Like <strong>Course_ID.Year_Code.Student_no</strong></p>
  
  <p>In order to retrieve same digit numbers I fill my raw student number (which is given on creation) as 0001, 0002.</p>
  
  <p>When I try to retrieve my student number by getting this number from database </p>
  
  <p>I get results without zeros. </p>
  
  <p>Lets say  <strong>Course_ID 22</strong> and <strong>Year_Code 16</strong></p>
  
  <p>and <strong>Student_NO 0005</strong> </p>
  
  <p>I return number as <strong>22165</strong> which should be <strong>22160005</strong>.
  this is how I get students. </p>
  
  <pre><code>$students = \App\Student::with('payment')-&gt;where('branch', $id)-&gt;get();
  </code></pre>
  
  <p>(I actually recieve student_no without zeros with the query below) </p>
  
  <p>and this is how I write in blade </p>
  
  <pre><code>&lt;td&gt;{{$student-&gt;Course_ID.$student-&gt;course-&gt;year_code.$student-&gt;student_no}}  &lt;/td&gt;
  </code></pre>
  
  <p><strong>PS: I do know how to retrieve numbers with native php by using str_pad. I ask if there is a method to do it on Eloquent.</strong></p>