public function syncdata() { $sync = Input::get('Sync'); if ($sync) { $response["error"] = "false"; $EquipmentDetails = Equipment::all(); foreach ($EquipmentDetails as $index => $equip) { $response["Equipment"][$index]["Ecode"] = $equip->Ecode; $response["Equipment"][$index]["Value"] = $equip->Name; } $MaintainenceDetails = Maintainence::all(); foreach ($MaintainenceDetails as $index => $Maintain) { $response["Maintainence"][$index]["Ecode"] = $Maintain->Ecode; $response["Maintainence"][$index]["Value"] = $Maintain->Name; } return json_encode($response); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $Maintainence = Maintainence::all(); return view('maintainence.index', compact('Maintainence')); }