I think you made a typo near Iklan::with(user:id... (there is a column which shouldn't be there)
Try one of the following code snippets below.
public function pdf1(Request $request)
{
$date = $request->date;
$iklan = Iklan::with('user_id,name,created_at')->orderBy('created_at', 'asc')->where('waktupesan', $date)->take(50)->get();
$pdf1 = \PDF::loadView('pdf1', compact('iklan'))->setPaper('A4', 'landscape');
return $pdf1->stream();
}
Or
public function pdf1(Request $request)
{
$date = $request->date;
$iklan = Iklan::with('user,id,name,created_at')->orderBy('created_at', 'asc')->where('waktupesan', $date)->take(50)->get();
$pdf1 = \PDF::loadView('pdf1', compact('iklan'))->setPaper('A4', 'landscape');
return $pdf1->stream();
}
Or, based on the fillable fields from your model,
public function pdf1(Request $request)
{
$date = $request->date;
$iklan = Iklan::with('id_user,name,created_at')->orderBy('created_at', 'asc')->where('waktupesan', $date)->take(50)->get();
$pdf1 = \PDF::loadView('pdf1', compact('iklan'))->setPaper('A4', 'landscape');
return $pdf1->stream();
}
Hope this helps you.