Update labels show
Update labels show
This commit is contained in:
parent
298dc28dc6
commit
7adb5ddff2
|
@ -38,7 +38,16 @@ class LabelsController extends Controller
|
||||||
|
|
||||||
public function show(Labels $label)
|
public function show(Labels $label)
|
||||||
{
|
{
|
||||||
return view('labels.show', compact(['label']));
|
$labels = DB::table('labels_assigned as las')
|
||||||
|
->leftJoin('pricings as p', 'las.service_id', '=', 'p.service_id')
|
||||||
|
->leftJoin('servers as s', 'las.service_id', '=', 's.id')
|
||||||
|
->leftJoin('shared_hosting as sh', 'las.service_id', '=', 'sh.id')
|
||||||
|
->leftJoin('reseller_hosting as r', 'las.service_id', '=', 'r.id')
|
||||||
|
->leftJoin('domains as d', 'las.service_id', '=', 'd.id')
|
||||||
|
->where('las.label_id', '=', $label->id)
|
||||||
|
->get(['p.service_type', 'p.service_id', 's.hostname', 'sh.main_domain as shared', 'r.main_domain as reseller', 'd.domain', 'd.extension']);
|
||||||
|
|
||||||
|
return view('labels.show', compact(['label', 'labels']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit(Labels $label)
|
public function edit(Labels $label)
|
||||||
|
|
|
@ -5,28 +5,54 @@
|
||||||
</x-slot>
|
</x-slot>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<x-card class="shadow mt-3">
|
<x-card class="shadow mt-3">
|
||||||
<x-back-button>
|
<div class="row">
|
||||||
<x-slot name="href">{{ route('labels.index') }}</x-slot>
|
<div class="col-12 col-md-6 mb-2">
|
||||||
Go back
|
<h2>{{ $label->label }}</h2>
|
||||||
</x-back-button>
|
</div>
|
||||||
|
<div class="col-12 col-md-6 text-md-end">
|
||||||
|
<h6 class="text-muted pe-lg-4">{{ $label->id }}</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-6">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-borderless text-nowrap">
|
<table class="table table-borderless text-nowrap">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@foreach($labels as $label)
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-4 py-2 font-bold">label name</td>
|
<td class="py-2 text-muted">
|
||||||
<td>{{ $label->label}}</td>
|
@if($label->service_type === 1)
|
||||||
</tr>
|
Server
|
||||||
<tr>
|
@elseif($label->service_type === 2)
|
||||||
<td class="px-4 py-2 font-bold">label id</td>
|
Shared
|
||||||
<td><code>{{ $label->id}}</code></td>
|
@elseif($label->service_type === 3)
|
||||||
|
Reseller
|
||||||
|
@elseif($label->service_type === 4)
|
||||||
|
Domain
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($label->service_type === 1)
|
||||||
|
<a href="{{ route('servers.show', $label->service_id) }}" class="text-decoration-none">{{$label->hostname}}</a>
|
||||||
|
@elseif($label->service_type === 2)
|
||||||
|
<a href="{{ route('shared.show', $label->service_id) }}" class="text-decoration-none">{{$label->shared}}</a>
|
||||||
|
@elseif($label->service_type === 3)
|
||||||
|
<a href="{{ route('reseller.show', $label->service_id) }}" class="text-decoration-none">{{$label->reseller}}</a>
|
||||||
|
@elseif($label->service_type === 4)
|
||||||
|
<a href="{{ route('domains.show', $label->service_id) }}" class="text-decoration-none">{{$label->domain}}.{{$label->extension}}</a>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<x-back-button>
|
||||||
|
<x-slot name="href">{{ route('labels.index') }}</x-slot>
|
||||||
|
Go back
|
||||||
|
</x-back-button>
|
||||||
</x-card>
|
</x-card>
|
||||||
</div>
|
</div>
|
||||||
</x-app-layout>
|
</x-app-layout>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user