Added labels to dns show controller

Added labels to dns  show controller
This commit is contained in:
cp6 2022-03-05 01:11:56 +11:00
parent de34f87bb2
commit d4f2b57b02

View File

@ -66,7 +66,13 @@ class DNSController extends Controller
public function show(DNS $dn) public function show(DNS $dn)
{ {
$dns = DNS::findOrFail($dn->id); $dns = DNS::findOrFail($dn->id);
return view('dns.show', compact(['dn', 'dns']));
$labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $dn->id)
->get(['labels.label']);
return view('dns.show', compact(['dn', 'dns', 'labels']));
} }
public function edit(DNS $dn) public function edit(DNS $dn)