title: Laravel 5.4 - Get one data from each duplicate data row
body: <p>I want to make select options to display the month taken from the created_at column of a table</p>
  
  <pre><code>// item_ins
  +----+--------+---------------------+
  | id |  item  |     created_at      |
  +----+--------+---------------------+
  |  1 | item 1 | 2017-12-11 10:37:52 |
  |  2 | item 2 | 2017-12-11 10:38:17 |
  |  3 | item 3 | 2018-01-12 01:28:43 |
  |  4 | item 4 | 2018-01-12 01:30:14 |
  |  5 | item 5 | 2018-02-12 01:30:05 |
  |  6 | item 6 | 2018-02-12 01:30:42 |
  +----+--------+---------------------+
  </code></pre>
  
  <p>in the table there are each two months december, january and february, and i want to get one from every same month, i try like this</p>
  
  <pre><code>$months= ItemIn::distinct('created_at')-&gt;pluck('created_at');
  </code></pre>
  
  <p>but I still get the same two months for each month because the timing is not the same, as below </p>
  
  <p>and I'm still confused with how to get just a month because in the above way I get also years and days</p>
  
  <pre><code>[
      {
          "date": "2017-12-11 10:37:52.000000",
          "timezone_type": 3,
          "timezone": "UTC"
      },
      {
          "date": "2017-12-11 10:38:17.000000",
          "timezone_type": 3,
          "timezone": "UTC"
      },
      {
          "date": "2018-01-12 01:28:43.000000",
          "timezone_type": 3,
          "timezone": "UTC"
      },
      {
          "date": "2018-01-12 01:29:14.000000",
          "timezone_type": 3,
          "timezone": "UTC"
      },
      {
          "date": "2018-02-12 01:30:05.000000",
          "timezone_type": 3,
          "timezone": "UTC"
      },
      {
          "date": "2018-02-12 01:30:22.000000",
          "timezone_type": 3,
          "timezone": "UTC"
      },
  ]
  </code></pre>