/** * Generate mutator method's name to get attribute. Used to check if method exists * @param string $key method name * @return string */ protected function generateGetMutatorName($key) { $key = Str::studly($key); return "get{$key}Attribute"; }