Last active
August 29, 2015 13:56
-
-
Save Dragory/8920458 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CustomerAffiliationController extends BaseController | |
{ | |
public function index($customer_id) | |
{ | |
$affiliations = Affiliation::with("AffiliationCategory", "Organism")->where("customer_id","=", $customer_id)->get(); | |
return $affiliations; | |
} | |
public function store($customer_id) | |
{ | |
$input = Input::json(); | |
$customer = Customer::find($customer_id); | |
$customer->affiliations()->sync($input); | |
$customer->save(); | |
return '';//Response::eloquent($customer); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"1": {"affiliation_category_id":7,"started_at_year":2015}, | |
"2": {"affiliation_category_id":8,"started_at_year":2016} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment