Mass changes

This commit is contained in:
Simon Pocrnjič
2025-10-04 23:36:18 +02:00
parent ab50336e97
commit fe91c7e4bc
46 changed files with 5738 additions and 1873 deletions
+4 -3
View File
@@ -6,7 +6,6 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
class Activity extends Model
{
@@ -43,9 +42,11 @@ protected static function booted()
// If an activity with a due date is added for a contract, update the related account's promise_date
if (! empty($activity->contract_id) && ! empty($activity->due_date)) {
DB::table('accounts')
\App\Models\Account::query()
->where('contract_id', $activity->contract_id)
->update(['promise_date' => $activity->due_date, 'updated_at' => now()]);
->update(
['promise_date' => $activity->due_date, 'updated_at' => now()],
);
}
});
}