Question: I try to increment carbon Date in for loop as the following 

```
for($x = 0; $x < count($ms); $x++) {

    $msh = MaintenanceServiceNotifications::where('main_service_id', $ms[$x]->id)->where('status', 'done')->orderBy('created_at', 'desc')->first();

    if(Carbon::now() > $msh->created_at->addMinutes($ms[$x]->notification_period*2)) {

        for ($i = 0; $i < sizeof($customersNot)-1; $i++) {

            //here i need to get created_at and 30 minutes for it     
            $created_at[$i] = $msh->created_at->addMinutes($ms[$x]->notification_period);

            MaintenanceServiceNotifications::create([
                'main_service_id' => $ms[$x]->id,
                'user_id' => Auth::user()->id,
                'not_name' => 'some text',
                'created_at' => $created_at[$i]
            ]);
        }
    }
}

```

I need to increment date in each for loop and pass it to `created_at` 
for example 

**in first loop** `2015-11-27 23:00:00` then `creteat_at => 2015-11-27 23:00:00`

**in second loop** `2015-11-27 23:30:00` then `created_at =>2015-11-27 23:30:00`

Any Suggestions,Thanks

Answer: 
My suggestion with some tweaks,

```
foreach ($ms as $m) {
    $msh = MaintenanceServiceNotifications::where('main_service_id', $m->id)->where('status', 'done')->latest()->first();

    if (Carbon::now() > $msh->created_at->addMinutes($m->notification_period*2)) {
        for ($i=0; $i<sizeof($customersNot)-1; $i++) {
            MaintenanceServiceNotifications::create([
                'main_service_id' => $m->id,
                'user_id' => Auth::user()->id,
                'not_name' => 'some text',
                'created_at' => $msh->created_at->addMinutes($m->notification_period * $i) // add 30*0, 30*1, 30*2 ...
            ]);
        }
    }
}

```
try this code :

```
$minutes = $ms[$x]->notification_period;
$dt = Carbon::createFromFormat('Y-m-d H:i:s', $msh->created_at);
$dt->addMinutes($minutes);
$create_at = $dt->toDateTimeString();

```