Support the ongoing development of Laravel.io →
Database Eloquent Views

Please help me, i have a table with this record & query.

SELECT DISTINCT
	aa.id,
	aa.id_user,
	aa.id_outlet,
	aa.array_tanggal as plan_date
FROM
	visit_plan_outlet AS aa
WHERE
	aa.array_tanggal IS NOT NULL
LIMIT 10
id id_user id_outlet plan_date
20	1309	166	[5,21,25]
21	1309	175	[6,26]
22	1309	171	[1,25]
23	1309	178	[6,26]
24	1309	186	[8,28]
25	1309	184	[7,11]
26	1309	183	[7,27]
27	1309	195	[8,28]
28	1309	196	[11,29]
29	1309	257	[14]

My question is: How to show record with plan_date same with current date ? with laravel, not using LIKE because if we use like sample:

$current_date = date('j'); //Exp: Date One (1)
aa.array_date LIKE '$current_date'

But show record too: (This wrong)

20	1309	166	[5,21,25]
22	1309	171	[1,25]
25	1309	184	[7,11]
28	1309	196	[11,29]
29	1309	257	[14]

Must be shown:

22	1309	171	[1,25]
Last updated 3 years ago.
0
SELECT DISTINCT
	aa.id,
	aa.id_user,
	aa.id_outlet,
	aa.array_tanggal as plan_date
FROM
	visit_plan_outlet AS aa
WHERE
	aa.array_tanggal IS NOT NULL
Group BY aa.array_tanggal as plan_date
LIMIT 10
Last updated 6 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Kang Mul omysurya Joined 24 Aug 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.