/** * @param string $method * @param array $arguments * * @return \Illuminate\Database\Eloquent\Relations\EmbedsMany|mixed */ public function __call($method, $arguments) { if (in_array($method, $this->getFillable())) { return $this->embedsOne($this->getTranslationModel(), $method); } return parent::__call($method, $arguments); }
/** * Dynamically pass missing methods to the permissions. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { $methods = ['hasAccess', 'hasAnyAccess']; if (in_array($method, $methods)) { $permissions = $this->getPermissionsInstance(); return call_user_func_array([$permissions, $method], $parameters); } return parent::__call($method, $parameters); }
/** * Handle dynamic method calls into the method. * Overrided from {@link Eloquent} to implement recognition of the {@link $relationsData} array. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { if (array_key_exists($method, static::$relationsData)) { return $this->handleRelationalArray($method); } return parent::__call($method, $parameters); }