In CodeIgniter 3.x, we can pass data with array by using this code:
$data=array(
'apartment' => $this->apartmentmodel->get_all(),
'title' => "List Apartement"
);
$this->load->view('apartment/index',$data);
But, this code is not working when implement on my Laravel 6 project
$data=array(
'apartment' => DB::table('apartment')->get();,
'title' => "List Apartement"
);
return view(apartment.index,$data);
What is the problem and how to fix it? Anyone can help me?