/** * Display a listing of the resource. * * @param PortForward $forward * * @return Response */ public function index(PortForward $forward, Clones $clone) { $settings = $this->setting->all(); $forwards = $forward->orderBy('starting_port', 'asc')->get(); $clones = $clone->all(); $this->setViewData(compact('settings', 'forwards', 'clones')); }
public function getDisplayPortAttribute() { $port = $this->port; $forward = PortForward::where('destination_port', $port)->first(); if ($forward != null) { return $forward->starting_port; } return $port; }