Sorry for the short question title, this absurdly simple thing doesn't work and I have no idea why. I'm trying to manually set the key on a model relation in Laravel (why manually? I need to compare the current key to what I'm setting it to, to see if there's been a change; as far as I know there's no other way of doing this):
$this->mission->featured_image = $input['featured_image'];
Where $input['featured_image']
is 3. Proof.
A Featured Image is a relation defined as such on my Mission
model:
class Mission extends Eloquent {
public function featuredImage() {
return $this->belongsTo('Object', 'featured_image');
}
}
After stepping through the assignment, $this->mission->featured_image
remains null, despite that what I am assigning it isn't. Thoughts?