public function updateData() { $sample = Sample::first(); if (!$sample) { $this->insert_from_json(); $this->insert_from_csv(); return 1; } else { return 0; } }