refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s

This commit is contained in:
Kroonk
2026-05-22 16:19:55 +02:00
parent 38cc4c09ca
commit a213a1dba0
2215 changed files with 242567 additions and 6015 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Http\Controllers\Settings;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Contact\ReminderRule;
use App\Traits\JsonRespondController;
class ReminderRulesController extends Controller
{
use JsonRespondController;
/**
* Get all the reminder rules.
*/
public function index()
{
$reminderRules = auth()->user()->account->reminderRules;
return $reminderRules->map(function ($reminderRule) {
return $this->format($reminderRule);
});
}
public function toggle(Request $request, ReminderRule $reminderRule)
{
$reminderRule->active = ! $reminderRule->active;
$reminderRule->save();
return $this->respond([
'data' => $this->format($reminderRule),
]);
}
private function format(ReminderRule $reminderRule)
{
return [
'id' => $reminderRule->id,
'number_of_days_before' => $reminderRule->number_of_days_before,
'active' => $reminderRule->active,
];
}
}