changes to sms packages and option to create user

This commit is contained in:
Simon Pocrnjič
2025-11-06 21:54:07 +01:00
parent ad8e0d5cee
commit 1395b72ae8
102 changed files with 1386 additions and 319 deletions
@@ -14,8 +14,8 @@ public function index()
{
return Inertia::render('Settings/ContractConfigs/Index', [
'configs' => ContractConfig::with(['type:id,name', 'segment:id,name'])->get(),
'types' => ContractType::query()->get(['id','name']),
'segments' => Segment::query()->where('active', true)->get(['id','name']),
'types' => ContractType::query()->get(['id', 'name']),
'segments' => Segment::query()->where('active', true)->get(['id', 'name']),
]);
}
@@ -40,8 +40,8 @@ public function store(Request $request)
ContractConfig::create([
'contract_type_id' => $data['contract_type_id'],
'segment_id' => $data['segment_id'],
'is_initial' => (bool)($data['is_initial'] ?? false),
'active' => (bool)($data['active'] ?? true),
'is_initial' => (bool) ($data['is_initial'] ?? false),
'active' => (bool) ($data['active'] ?? true),
]);
return back()->with('success', 'Configuration created');
@@ -57,8 +57,8 @@ public function update(ContractConfig $config, Request $request)
$config->update([
'segment_id' => $data['segment_id'],
'is_initial' => (bool)($data['is_initial'] ?? $config->is_initial),
'active' => (bool)($data['active'] ?? $config->active),
'is_initial' => (bool) ($data['is_initial'] ?? $config->is_initial),
'active' => (bool) ($data['active'] ?? $config->active),
]);
return back()->with('success', 'Configuration updated');
@@ -67,6 +67,7 @@ public function update(ContractConfig $config, Request $request)
public function destroy(ContractConfig $config)
{
$config->delete();
return back()->with('success', 'Configuration deleted');
}
}