This is the case:
In my database I have a table deployments. The rows in the table also have a field created_at. Now I would like to select all rows where the created_date is older than 14 days. But I'm stuck on how to do this with Carbon. My query now looks like this:
$passed = Deployment::where('created_at', '>=', );
Can anyone help me with this?
You can use the subDays()
method:
$passed = Deployment::where('created_at', '<=', Carbon::now()->subDays(14)->toDateTimeString());