Initial commit

This commit is contained in:
gustavooth
2026-07-23 22:56:30 -03:00
commit 22a1006598
1816 changed files with 410742 additions and 0 deletions
@@ -0,0 +1,51 @@
<?php
namespace FluentCrm\App\Http\Controllers;
use FluentCrm\App\Models\CustomContactField;
use FluentCrm\App\Services\Helper;
/**
* CustomContactFieldsController - REST API Handler Class
*
* REST API Handler
*
* @package FluentCrm\App\Http
*
* @version 1.0.0
*/
class CustomContactFieldsController extends Controller
{
public function getGlobalFields(CustomContactField $model)
{
return $this->sendSuccess(
$model->getGlobalFields(
$this->request->get('with', [])
)
);
}
public function saveGlobalFields(CustomContactField $model)
{
$fields = $model->saveGlobalFields(
Helper::parseArrayOrJson($this->request->get('fields'))
);
return $this->sendSuccess([
'fields' => $fields,
'message' => __('Fields saved successfully!', 'fluent-crm')
]);
}
public function updateGroupName(CustomContactField $model)
{
$oldName = sanitize_text_field($this->request->get('old_name'));
$newName = sanitize_text_field($this->request->get('new_name'));
$updatedCustomFields = $model->updateGroupName($oldName, $newName);
return $this->sendSuccess([
'fields' => $updatedCustomFields,
'message' => __('Group name updated successfully!', 'fluent-crm')
]);
}
}