<?php

namespace App\Http\Controllers;

use App\Microsoft\Dynamics\Account;
use App\Microsoft\Dynamics\Contact;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class DynamicsCrmController extends Controller
{
	public function updateAccount(Request $request)
	{
		Log::info("updateAccount logging request->all()");
		Log::info($request->all());
		$account = new Account($request->all());
		$account->toClient()->save();
		Log::info("Successfully updated the account.\n");
	}

	public function updateContact(Request $request)
	{
		Log::info("updateContact logging request->all()");
		Log::info($request->all());
		$contact = new Contact($request->all());
		$contact->toCustomer()->save();
		Log::info("Successfully updated the contact.\n");
	}
}
