diff --git a/app/transformers/ComponentTransformer.php b/app/CachetHq/Cachet/Transformers/ComponentTransformer.php similarity index 79% rename from app/transformers/ComponentTransformer.php rename to app/CachetHq/Cachet/Transformers/ComponentTransformer.php index c7dd8129f..e8c61770d 100644 --- a/app/transformers/ComponentTransformer.php +++ b/app/CachetHq/Cachet/Transformers/ComponentTransformer.php @@ -1,6 +1,12 @@ (int) $component->id, @@ -13,4 +19,5 @@ class ComponentTransformer extends \League\Fractal\TransformerAbstract { 'updated_at' => $component->updated_at->timestamp, ]; } + } \ No newline at end of file diff --git a/app/transformers/IncidentTransformer.php b/app/CachetHq/Cachet/Transformers/IncidentTransformer.php similarity index 80% rename from app/transformers/IncidentTransformer.php rename to app/CachetHq/Cachet/Transformers/IncidentTransformer.php index 5fbc46bf4..b22969101 100644 --- a/app/transformers/IncidentTransformer.php +++ b/app/CachetHq/Cachet/Transformers/IncidentTransformer.php @@ -1,7 +1,14 @@ parent; $transformer = $component->getTransformer(); diff --git a/app/transformers/MetricTransformer.php b/app/CachetHq/Cachet/Transformers/MetricTransformer.php similarity index 75% rename from app/transformers/MetricTransformer.php rename to app/CachetHq/Cachet/Transformers/MetricTransformer.php index ce4c6c5e4..1ad3b6b65 100644 --- a/app/transformers/MetricTransformer.php +++ b/app/CachetHq/Cachet/Transformers/MetricTransformer.php @@ -1,6 +1,12 @@ (int) $metric->id, @@ -12,4 +18,5 @@ class MetricTransformer extends \League\Fractal\TransformerAbstract { 'updated_at' => $metric->updated_at->timestamp, ]; } + } \ No newline at end of file diff --git a/app/models/Component.php b/app/models/Component.php index 94b5a366b..00dae7345 100644 --- a/app/models/Component.php +++ b/app/models/Component.php @@ -35,6 +35,6 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable * @return ComponentTransformer */ public function getTransformer() { - return new ComponentTransformer(); + return new CachetHQ\Cachet\Transformers\ComponentTransformer(); } } \ No newline at end of file diff --git a/app/models/Incident.php b/app/models/Incident.php index 0193b202a..013c8a155 100644 --- a/app/models/Incident.php +++ b/app/models/Incident.php @@ -3,6 +3,7 @@ use Watson\Validating\ValidatingTrait; class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableInterface { + use ValidatingTrait; use Illuminate\Database\Eloquent\SoftDeletingTrait; @@ -54,6 +55,6 @@ class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableI * @return IncidentTransformer */ public function getTransformer() { - return new IncidentTransformer(); + return new CachetHQ\Cachet\Transformers\IncidentTransformer(); } } \ No newline at end of file diff --git a/app/models/Metric.php b/app/models/Metric.php index 9db9a2c34..47a0ef56a 100644 --- a/app/models/Metric.php +++ b/app/models/Metric.php @@ -24,9 +24,9 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt /** * Get the transformer instance. * - * @return ComponentTransformer + * @return MetricTransformer */ public function getTransformer() { - return new MetricTransformer(); + return new CachetHQ\Cachet\Transformers\MetricTransformer(); } } \ No newline at end of file diff --git a/composer.json b/composer.json index 27e4bb291..ea832b182 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,6 @@ "app/commands", "app/controllers", "app/models", - "app/transformers", "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php", diff --git a/package.json b/package.json new file mode 100644 index 000000000..e69de29bb