---
title: "Discussion on \"Laravel Command: Return error msg and exit code on 1-line\" | Hashnode"
description: "Discussion on \"Laravel Command: Return error msg and exit code on 1-line\". Hi guys,\nA small tip for your weekend. For Laravel's devs out there.\nEver wonder how can I write the error and then stop the command immediately (with an error code) in 1 line?\nLemme show you how :v\nToday our code looks like this:\npublic function han..."
url: "https://hashnode.com/posts/laravel-command-return-error-msg-and-exit-code-on-1-line/6432af72f37faba1228312cf"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Laravel Command: Return error msg and exit code on 1-line](https://sethphat.dev/laravel-command-return-error-msg-and-exit-code-on-1-line?utm_source=hashnode&utm_medium=feed)

Hi guys, A small tip for your weekend. For Laravel's devs out there. Ever wonder how can I write the error and then stop the command immediately (with an error code) in 1 line? Lemme show you how :v Today our code looks like this: public function han...

Apr 9, 2023 · 1 min read · sethphat.dev  
Read the article

-   [#laravel](https://hashnode.com/tag/laravel)
-   [#php](https://hashnode.com/tag/php)
-   [#laravelframework](https://hashnode.com/tag/laravelframework)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Seth Chen](https://hashnode.com/@sethphat)

@sethphat · Desire Grand Prix

  
[View profile](https://hashnode.com/@sethphat)

Seth Phat Geek Blog

develops awesome software, contributes to OSS, writes tech tips, and loves Vietnamese milk coffee!

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
