public function popCommand($device) { $record = $this->model->where('device_id', $device)->first(); $commandToSend = null; if ($record) { $commands = explode(',', $record->queued_command); $commandToSend = array_shift($commands); $record->queued_command = implode(',', $commands); $record->save(); } return $commandToSend; }
/** * Display a listing of the resource. * * @return Response */ public function index() { $devices = ACSNode::all(); return view('devices.index', ['devices' => $devices]); }