<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz" -->

---
title: Track Code deployments in New Relic with Laravel commands
description: A custom Laravel Artisan command sends deployment tracking data to New Relic via its GraphQL API, offering an alternative to GitHub Actions-based tracking....
canonical: https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Track Code deployments in New Relic with Laravel commands | daily.dev
og:description: A custom Laravel Artisan command sends deployment tracking data to New Relic via its GraphQL API, offering an alternative to GitHub Actions-based tracking....
og:url: https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz
og:image: https://api.daily.dev/og/posts/M4rMVrinZ.png
og:image:alt: Track Code deployments in New Relic with Laravel commands
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Track Code deployments in New Relic with Laravel commands

**[Daniel Petrica](https://daily.dev/sources/danielpetrica)** · 3 min read · 0 upvotes · 0 comments

## Summary

A custom Laravel Artisan command sends deployment tracking data to New Relic via its GraphQL API, offering an alternative to GitHub Actions-based tracking. Running 'php artisan app:deploy-mark' retrieves the current git commit hash and posts a changeTrackingCreateDeployment mutation to New Relic, using an API key and app GUID configured through services.php and .env. The command works across different CI/CD pipeline stacks. A later update added a consulting pitch from the author, who offers New Relic/observability consulting services via a contact form.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://danielpetrica.com/posts/track-code-deployments-in-new-relic-with-laravel-commands>

## Questions this post answers

### How can I track deployments in New Relic without using GitHub Actions?

Create a custom Laravel Artisan command that posts a changeTrackingCreateDeployment GraphQL mutation to New Relic's API. The command runs 'git log --pretty=%h -n1 HEAD' to get the current commit hash as the version, sends it along with an entity GUID to New Relic's endpoint using an API key, and can be triggered as a final step in any CI/CD pipeline via 'php artisan app:deploy-mark'.

_See a working Laravel command for New Relic deployment tracking curated on daily.dev._

### What GraphQL mutation does New Relic use to record a new deployment?

New Relic uses the changeTrackingCreateDeployment mutation, sent to the region-specific GraphQL endpoint such as https://api.eu.newrelic.com/graphql. The mutation requires a deployment object with a version string (commonly a git commit hash) and an entityGuid identifying the monitored application, and it returns a deploymentId and entityGuid on success.

_Developers wiring up observability pipelines can find integration snippets like this via daily.dev._

## Similar posts on daily.dev

- [Monitor Your PHP Applications with AppSignal](https://daily.dev/posts/monitor-your-php-applications-with-appsignal-yuyfueyh7) · AppSignal · 1 upvotes · 0 comments
- [Introducing Flare’s next big feature: performance monitoring](https://daily.dev/posts/introducing-flare-s-next-big-feature-performance-monitoring-ehqyaoale) · FREEK.DEV · 15 upvotes · 0 comments
- [Laravel Cloud API and CLI: Ship Faster, Automate More](https://daily.dev/posts/laravel-cloud-api-and-cli-ship-faster-automate-more-brfolid9r) · Laravel · 3 upvotes · 0 comments
- [Laravel Auditor Audits Your App With Your Own AI Agent](https://daily.dev/posts/laravel-auditor-audits-your-app-with-your-own-ai-agent-u9kucbtdl) · Laravel News · 10 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#cicd](https://daily.dev/tags/cicd), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel), [#observability](https://daily.dev/tags/observability)

[View this post on daily.dev](https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Track Code deployments in New Relic with Laravel commands","url":"https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz"},"datePublished":"2026-09-29T12:32:28.068Z","dateModified":"2026-09-29T12:32:52.232Z","description":"A custom Laravel Artisan command sends deployment tracking data to New Relic via its GraphQL API, offering an alternative to GitHub Actions-based tracking....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f53142981d219e55c288a48672710af7?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f53142981d219e55c288a48672710af7?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Daniel Petrica","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Daniel Petrica","logo":"https://media.daily.dev/image/upload/s--jkfwlnJz--/f_auto,q_auto/v1774964393/logos/danielpetrica?_a=BAMAMiWQ0","url":"https://daily.dev/sources/danielpetrica"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,cicd,php,laravel,observability","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Daniel Petrica","item":"https://daily.dev/sources/danielpetrica"},{"@type":"ListItem","position":3,"name":"Track Code deployments in New Relic with Laravel commands"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/track-code-deployments-in-new-relic-with-laravel-commands-m4rmvrinz#faq","mainEntity":[{"@type":"Question","name":"How can I track deployments in New Relic without using GitHub Actions?","acceptedAnswer":{"@type":"Answer","text":"Create a custom Laravel Artisan command that posts a changeTrackingCreateDeployment GraphQL mutation to New Relic's API. The command runs 'git log --pretty=%h -n1 HEAD' to get the current commit hash as the version, sends it along with an entity GUID to New Relic's endpoint using an API key, and can be triggered as a final step in any CI/CD pipeline via 'php artisan app:deploy-mark'. See a working Laravel command for New Relic deployment tracking curated on daily.dev."}},{"@type":"Question","name":"What GraphQL mutation does New Relic use to record a new deployment?","acceptedAnswer":{"@type":"Answer","text":"New Relic uses the changeTrackingCreateDeployment mutation, sent to the region-specific GraphQL endpoint such as https://api.eu.newrelic.com/graphql. The mutation requires a deployment object with a version string (commonly a git commit hash) and an entityGuid identifying the monitored application, and it returns a deploymentId and entityGuid on success. Developers wiring up observability pipelines can find integration snippets like this via daily.dev."}}]}
```

