refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Contact\Reminder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ScheduleNewReminders extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Reminder::chunk(200, function ($reminders) {
|
||||
foreach ($reminders as $reminder) {
|
||||
if (is_null($reminder->frequency_number)) {
|
||||
$reminder->frequency_number = 1;
|
||||
$reminder->save();
|
||||
}
|
||||
|
||||
foreach ($reminder->account->users as $user) {
|
||||
$reminder->schedule($user);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user