public function __call($method, $parameters)
{
$value = $parameters[0] ?? null;
// Alias to attach
if ('attachTo' == substr($method, 0, 8)) {
$field = lcfirst(substr($method, 8));
return $this->attach($field, $value);
}
// Alias to embed
if ('embedTo' == substr($method, 0, 7)) {
$field = lcfirst(substr($method, 7));
return $this->embed($field, $value);
}
throw new BadMethodCallException(sprintf('The following method can not be reached or does not exist: %s@%s', get_class($this), $method));
}