In general, there is a request:

DB::table('vacancies') ->leftJoin('periods', 'vacancies.id', '=', 'periods.id_vacancy') ->select('vacancies.title_u', 'periods.date_start', 'periods.date_end') ->take(1)->get(); 

Result:

 array:1 [▼ 0 => {#389 ▼ +"title_u": "Водитель" +"date_start": 1469680740 +"date_end": 1469939940 } ] 

We need to make a request, so that the vacancies have several periods in the array (which is lower), How can this be done?

 array:1 [▼ 0 => array:2 [▼ "title_u" => "Водитель" "periods" => array:2 [▼ "date_start" => 1469680740 "date_end" => 1469939940 ] ] ] 
  • How did you try to do this? Have you tried to form the necessary array with your hands? - VenZell
  • Yes)) namudril of course - Ali
  • Show how you tried, right in the question - VenZell
  • those. I have not tried, I do not know how to formulate a request - Ali

0