Illuminate\ Database\QueryException
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in field list is ambiguous
SELECT DATE(created_at) AS date FROM `schedules` INNER JOIN `events` ON `schedules`.`event_id` = `events`.`id` INNER JOIN `users` ON `schedules`.`user_id` = `users`.`id` WHERE `schedules`.`user_id` = 3 GROUP BY `date`
The error message is saying that the created_at column is ambiguous because it exists in multiple tables. To fix this, you need to specify which table's created_at column you want to select. You can do this by prefixing the column name with the table name or alias. In this case, you can use the schedules table alias like this: