Get rows where created date is older than 14 days
You can use Carbon::now()->subDays(14)
$passed = Deployment::where('created_at', '>=', Carbon::now()->subDays(14)->toDateTimeString());
You can read more about Carbon its feature here Carbon Documentation
You can use the subDays()
method:
$passed = Deployment::where('created_at', '<=', Carbon::now()->subDays(14)->toDateTimeString());