feat: add GeneratesUniqueSlug class for unique slug generation
feat: create PostCategoryFactory for generating post category data feat: create PostFactory for generating post data feat: add retry_requested_at column to services table feat: add vcenter provisioning fields to products table feat: add module_host_id to os table feat: create email_notification_templates table for email templates feat: add scenario and format fields to template table feat: add admin fields to transactions table fix: update ticket table columns and types feat: add uuid to ticket table and backfill existing records fix: make ticket_reply user_id nullable feat: create notifications table for user notifications fix: make ticket uuid nullable feat: create post_categories table for blog categories feat: create posts table for blog posts feat: add invoice email template for PDF generation
This commit is contained in:
@@ -16,7 +16,7 @@ class OsGroupController extends Controller
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$query = OsGroup::withCount('os')
|
||||
->with(['os' => fn($q) => $q->orderBy('version')])
|
||||
->with(['os' => fn($q) => $q->with('host.datacenter.vCenter')->orderBy('version')])
|
||||
->when(
|
||||
$request->get('filter'),
|
||||
fn($q, $f) => $q->where('name', 'like', "%{$f}%")
|
||||
@@ -50,7 +50,7 @@ class OsGroupController extends Controller
|
||||
public function show(int $id): JsonResponse
|
||||
{
|
||||
$group = OsGroup::withCount('os')
|
||||
->with(['os' => fn($q) => $q->orderBy('version')])
|
||||
->with(['os' => fn($q) => $q->with('host.datacenter.vCenter')->orderBy('version')])
|
||||
->find($id);
|
||||
|
||||
if (! $group) {
|
||||
@@ -141,12 +141,18 @@ class OsGroupController extends Controller
|
||||
|
||||
private function formatOs(\App\Models\Os $os): array
|
||||
{
|
||||
$host = $os->relationLoaded('host') ? $os->host : null;
|
||||
|
||||
return [
|
||||
'id' => $os->id,
|
||||
'version' => $os->version,
|
||||
'template_id' => $os->template_id,
|
||||
'is_active' => (bool) $os->status,
|
||||
'os_group_id' => $os->os_group_id,
|
||||
'id' => $os->id,
|
||||
'version' => $os->version,
|
||||
'template_id' => $os->template_id,
|
||||
'is_active' => (bool) $os->status,
|
||||
'os_group_id' => $os->os_group_id,
|
||||
'module_host_id' => $os->module_host_id,
|
||||
'host_name' => $host?->name,
|
||||
'datacenter_name' => $host?->datacenter?->name,
|
||||
'vcenter_name' => $host?->datacenter?->vCenter?->host,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user