public function __construct() { $this->construct_command(); $this->connected_device = Connected::find(1); $this->process = new Process($this->cmd_path . $this->connected_device['ip_address']); // dd($this->process); }
/** * Here is the inicialization of the tad object depending * on the connected table state. */ public function __construct() { $this->connected_device = Connected::find(1); if ($this->connected_device['connected'] == 1) { $tadf = new TADFactory(['ip' => $this->connected_device['ip_address']]); $this->tad = $tadf->get_instance(); } else { $this->tad = null; } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $devices = Device::all(); $connected_device = Device::find(1); if (Connected::find(1) == null) { $connected_device = Connected::Create(['ip_address' => '127.0.0.1', 'device_id' => 0, 'connected' => 0]); } $connected_device = Connected::find(1); return view('pages.home', compact('devices', 'connected_device')); // ->with(['devices' => $devices, 'conne']); }
public function connectToIp($ip = '127.0.0.1') { $tadf = new TADFactory(['ip' => $ip]); $this->tad = $tadf->get_instance(); $status = $this->tad->is_alive(); $device = Device::where('ip_address', $ip)->first(); $connected_device = Connected::find(1); $connected_device->ip_address = $ip; $connected_device->device_id = $device->id; if ($status) { $connected_device->connected = 1; } else { $connected_device->connected = 0; } $connected_device->save(); return array($status); }
public function __construct($machineNumber = 1) { $this->zkcom = new COM("zkemkeeper.ZKEM"); $this->connected_device = Connected::find(1); }
/** * Here is the inicialization of the tad object depending * on the connected table state. */ public function __construct() { $this->connected_device = Connected::find(1); }