{"id":4097,"date":"2022-03-06T08:00:00","date_gmt":"2022-03-06T11:00:00","guid":{"rendered":"https:\/\/felipemateus.com\/?p=4097"},"modified":"2026-05-15T01:18:58","modified_gmt":"2026-05-15T04:18:58","slug":"how-to-create-commands-in-laravel","status":"publish","type":"post","link":"https:\/\/felipemateus.com\/en\/blog\/2022\/03\/how-to-create-commands-in-laravel","title":{"rendered":"How to create commands in Laravel?"},"content":{"rendered":"<p class=\"has-text-align-justify wp-block-paragraph\">First today I&#039;m going to talk about how to make commands in Laravel that serve to create crons or to execute commands directly from the terminal. In other words, all created commands appear in the list when you run artisan.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"453\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-17-38-16.png\" alt=\"list of commands \" class=\"wp-image-4101\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-17-38-16.png 972w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-17-38-16-300x140.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-17-38-16-768x358.png 768w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-17-38-16-18x8.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-17-38-16-150x70.png 150w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><figcaption class=\"wp-element-caption\">List of \u201cphp artisan\u201d commands in the image shows the command \u201cexample:command\u201d which is test command.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Creating the command in Laravel<\/h2>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">Create a new class for the command the class will have the variable <a style=\"color:#4E77FF\" href=\"#signature\">$signature<\/a> which is the variable with the signature used in the artisan command. As well as the variable <a style=\"color:#4E77FF\" href=\"#description\">$description<\/a> which is used to describe the commands.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">In this sense, you will also need to declare the function <a href=\"#handle\" style=\"color:#4E77FF\">handle()<\/a> used to perform the actions of the command. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\" id=\"signature\"><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"212\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/command.png\" alt=\"signature variable declaration\" class=\"wp-image-8094\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/command.png 544w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/command-300x117.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/command-18x7.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/command-150x58.png 150w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><figcaption class=\"wp-element-caption\">Variable Declaration  <span style=\"color:#4E77FF\">$signature<\/span><\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\" id=\"description\"><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"192\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/description_example.png\" alt=\"Description statement.\" class=\"wp-image-8084\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/description_example.png 756w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/description_example-300x76.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/description_example-18x5.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/05\/description_example-150x38.png 150w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><figcaption class=\"wp-element-caption\">Variable Declaration <span style=\"color:#4E77FF\">$description<\/span><\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\" id=\"handle\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"275\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-21-56-38.png\" alt=\"handle function declaration\" class=\"wp-image-4109\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-21-56-38.png 507w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-21-56-38-300x163.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-21-56-38-18x10.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-05-21-56-38-150x81.png 150w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><figcaption class=\"wp-element-caption\"> Occupation <span style=\"color:#4E77FF\">handle()<\/span><\/figcaption><\/figure>\n<\/div>\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-2130373218745562\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block; text-align:center;\"\n     data-ad-layout=\"in-article\"\n     data-ad-format=\"fluid\"\n     data-ad-client=\"ca-pub-2130373218745562\"\n     data-ad-slot=\"9921478851\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">creating provider<\/h2>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">In addition, it is necessary to create a class <a href=\"https:\/\/laravel-guide.readthedocs.io\/en\/latest\/providers\/\" target=\"_blank\" rel=\"noreferrer noopener\">provider<\/a> which will be responsible for importing the commands into the application. However if you are creating outside of a package you need to import in class <a href=\"https:\/\/github.com\/laravel\/laravel\/blob\/8.x\/app\/Console\/Kernel.php\" target=\"_blank\" rel=\"noreferrer noopener\">kernel.php<\/a> from the Laravel project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-text-align-center\">Boot Provider <\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"273\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-26-58.png\" alt=\"\" class=\"wp-image-4115\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-26-58.png 703w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-26-58-300x117.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-26-58-18x7.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-26-58-150x58.png 150w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><figcaption class=\"wp-element-caption\">Function example <span style=\"color:#4E77FF\">boot()<\/span> where to import the Commands in Laravel from Example<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading has-text-align-center\">Kernel Console<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"220\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-32-25.png\" alt=\"Example class import into Kernel from Laravel console.\" class=\"wp-image-4117\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-32-25.png 673w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-32-25-300x98.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-32-25-18x6.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/Captura-de-tela-de-2022-03-06-00-32-25-150x49.png 150w\" sizes=\"auto, (max-width: 673px) 100vw, 673px\" \/><figcaption class=\"wp-element-caption\">Kernel console import example<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Likewise, if you are creating a new package, don&#039;t forget to import the provider in <a href=\"https:\/\/github.com\/laravel\/laravel\/blob\/8.x\/config\/app.php\" target=\"_blank\" rel=\"noreferrer noopener\">app.php<\/a> and not <a href=\"https:\/\/github.com\/laravel\/laravel\/blob\/8.x\/composer.json\" target=\"_blank\" rel=\"noreferrer noopener\">composer.json<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Command template in Laravel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check out more about how the package and how to install and how to create a command in laravel in addition to also having the source code all in the link below.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-background wp-element-button\" href=\"https:\/\/github.com\/eufelipemateus\/laravel-package-example-command\" style=\"background-color:#e92727\" target=\"_blank\" rel=\"noreferrer noopener\">Access Project on Github<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">If you liked this post, don&#039;t forget to share it with your friends, it will help me a lot.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Subscribe to my newsletter to receive updates on new posts and new projects. Stay updated.<\/p>","protected":false},"excerpt":{"rendered":"<p>Create commands in Laravel with it you can create crons and run laravel function directly in the terminal.<\/p>","protected":false},"author":2,"featured_media":4120,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowhPjFCw:productID":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"local","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"Aprenda a criar comandos no Laravel e com eles executar fun\u00e7\u00f5es diretamente no terminal ou em uma cron. #Laravel  #Command #Console ","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1935],"tags":[1305,1068,1053],"class_list":["post-4097","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desenvolvimento-web-e-programacao","tag-framework","tag-laravel","tag-programacao"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Como criar comandos no Laravel? - Felipe Mateus @felipemateus<\/title>\n<meta name=\"description\" content=\"Como criar comandos no laravel? Aprenda a criar comandos no laravel pra executar comportamentos direto do terminal.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como criar comandos no Laravel? - Felipe Mateus @felipemateus\" \/>\n<meta property=\"og:description\" content=\"Como criar comandos no laravel? Aprenda a criar comandos no laravel pra executar comportamentos direto do terminal.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel\" \/>\n<meta property=\"og:site_name\" content=\"Felipe Mateus\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eufelipemateus\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/eufelipemateus\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-06T11:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-15T04:18:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"718\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Felipe Mateus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@eufelipemateus\" \/>\n<meta name=\"twitter:site\" content=\"@eufelipemateus\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Felipe Mateus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel\"},\"author\":{\"name\":\"Felipe Mateus\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\"},\"headline\":\"Como criar comandos no Laravel?\",\"datePublished\":\"2022-03-06T11:00:00+00:00\",\"dateModified\":\"2026-05-15T04:18:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel\"},\"wordCount\":306,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\"},\"image\":{\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/laravel-logo.png\",\"keywords\":[\"Framework\",\"Laravel\",\"Programa\u00e7\u00e3o\"],\"articleSection\":[\"Desenvolvimento Web e Programa\u00e7\u00e3o\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel\",\"url\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel\",\"name\":\"Como criar comandos no Laravel? - Felipe Mateus @felipemateus\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/laravel-logo.png\",\"datePublished\":\"2022-03-06T11:00:00+00:00\",\"dateModified\":\"2026-05-15T04:18:58+00:00\",\"description\":\"Como criar comandos no laravel? Aprenda a criar comandos no laravel pra executar comportamentos direto do terminal.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#primaryimage\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/laravel-logo.png\",\"contentUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/laravel-logo.png\",\"width\":1280,\"height\":718},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mundoazul.blog\\\/2022\\\/03\\\/como-criar-comandos-no-laravel#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/felipemateus.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Desenvolvimento Web e Programa\u00e7\u00e3o\",\"item\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/topicos\\\/desenvolvimento-web-e-programacao\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Como criar comandos no Laravel?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#website\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/\",\"name\":\"Felipe Mateus @felipemateus\",\"description\":\"Seja Bem-Vindo ao meu mundo azul.\",\"publisher\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\"},\"alternateName\":\"eufelipemateus\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/felipemateus.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\",\"name\":\"Felipe Mateus Rocha Martins\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/FELIPE-2-1024x1024.png\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/FELIPE-2-1024x1024.png\",\"contentUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/FELIPE-2-1024x1024.png\",\"width\":1024,\"height\":1024,\"caption\":\"Felipe Mateus\"},\"sameAs\":[\"https:\\\/\\\/felipemateus.com\",\"https:\\\/\\\/www.facebook.com\\\/eufelipemateus\",\"https:\\\/\\\/www.instagram.com\\\/eufelipemateus\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/eufelipemateus\\\/\",\"https:\\\/\\\/x.com\\\/eufelipemateus\",\"https:\\\/\\\/github.com\\\/eufelipemateus\",\"https:\\\/\\\/soundcloud.com\\\/eufelipemateus\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create commands in Laravel? - Felipe Mateus @felipemateus","description":"How to create commands in laravel? Learn how to create commands in laravel to execute behaviors directly from the terminal.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel","og_locale":"en_US","og_type":"article","og_title":"Como criar comandos no Laravel? - Felipe Mateus @felipemateus","og_description":"Como criar comandos no laravel? Aprenda a criar comandos no laravel pra executar comportamentos direto do terminal.","og_url":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel","og_site_name":"Felipe Mateus","article_publisher":"https:\/\/www.facebook.com\/eufelipemateus","article_author":"https:\/\/www.facebook.com\/eufelipemateus","article_published_time":"2022-03-06T11:00:00+00:00","article_modified_time":"2026-05-15T04:18:58+00:00","og_image":[{"width":1280,"height":718,"url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png","type":"image\/png"}],"author":"Felipe Mateus","twitter_card":"summary_large_image","twitter_creator":"@eufelipemateus","twitter_site":"@eufelipemateus","twitter_misc":{"Written by":"Felipe Mateus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#article","isPartOf":{"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel"},"author":{"name":"Felipe Mateus","@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6"},"headline":"Como criar comandos no Laravel?","datePublished":"2022-03-06T11:00:00+00:00","dateModified":"2026-05-15T04:18:58+00:00","mainEntityOfPage":{"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel"},"wordCount":306,"commentCount":0,"publisher":{"@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6"},"image":{"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#primaryimage"},"thumbnailUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png","keywords":["Framework","Laravel","Programa\u00e7\u00e3o"],"articleSection":["Desenvolvimento Web e Programa\u00e7\u00e3o"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel","url":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel","name":"How to create commands in Laravel? - Felipe Mateus @felipemateus","isPartOf":{"@id":"https:\/\/felipemateus.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#primaryimage"},"image":{"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#primaryimage"},"thumbnailUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png","datePublished":"2022-03-06T11:00:00+00:00","dateModified":"2026-05-15T04:18:58+00:00","description":"How to create commands in laravel? Learn how to create commands in laravel to execute behaviors directly from the terminal.","breadcrumb":{"@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#primaryimage","url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png","contentUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png","width":1280,"height":718},{"@type":"BreadcrumbList","@id":"https:\/\/mundoazul.blog\/2022\/03\/como-criar-comandos-no-laravel#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/felipemateus.com\/"},{"@type":"ListItem","position":2,"name":"Desenvolvimento Web e Programa\u00e7\u00e3o","item":"https:\/\/felipemateus.com\/blog\/topicos\/desenvolvimento-web-e-programacao"},{"@type":"ListItem","position":3,"name":"Como criar comandos no Laravel?"}]},{"@type":"WebSite","@id":"https:\/\/felipemateus.com\/#website","url":"https:\/\/felipemateus.com\/","name":"Felipe Mateus @felipemateus","description":"Welcome to my blue world.","publisher":{"@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6"},"alternateName":"eufelipemateus","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/felipemateus.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6","name":"Felipe Mateus Rocha Martins","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/04\/FELIPE-2-1024x1024.png","url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/04\/FELIPE-2-1024x1024.png","contentUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/04\/FELIPE-2-1024x1024.png","width":1024,"height":1024,"caption":"Felipe Mateus"},"sameAs":["https:\/\/felipemateus.com","https:\/\/www.facebook.com\/eufelipemateus","https:\/\/www.instagram.com\/eufelipemateus","https:\/\/www.linkedin.com\/in\/eufelipemateus\/","https:\/\/x.com\/eufelipemateus","https:\/\/github.com\/eufelipemateus","https:\/\/soundcloud.com\/eufelipemateus"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2022\/03\/laravel-logo.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pb1Prx-145","jetpack-related-posts":[{"id":3254,"url":"https:\/\/felipemateus.com\/en\/blog\/2021\/08\/iptv-channel-manager-package-in-laravel","url_meta":{"origin":4097,"position":0},"title":"IPTV Channel Manager m3u8 in Laravel","author":"Felipe Mateus","date":"14\/08\/2021","format":false,"excerpt":"I created a Laravel Package that manages iptv channels and generates playlist of m3u8 channels.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"Lista de canais esta lista mostra o numero do canal , a logo, o nome do canal e o nome do grupo al\u00e9m de ter links pra editar e excluir o canal.","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/08\/list_channel.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/08\/list_channel.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/08\/list_channel.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/08\/list_channel.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8252,"url":"https:\/\/felipemateus.com\/en\/blog\/2022\/08\/what-is-the-best-programming-language-to-create-websites","url_meta":{"origin":4097,"position":1},"title":"What is the best programming language to create websites?","author":"Felipe Mateus","date":"01\/08\/2022","format":false,"excerpt":"Learn more which is the best programming languages for the website.","rel":"","context":"In &quot;Desenvolvimento Web e Programa\u00e7\u00e3o&quot;","block_context":{"text":"Desenvolvimento Web e Programa\u00e7\u00e3o","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/web-development-and-programming"},"img":{"alt_text":"Qual \u00e9 Linguagem de Programa\u00e7\u00e3o para criar sites?","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/07\/programming-1920.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/07\/programming-1920.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/07\/programming-1920.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/07\/programming-1920.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/07\/programming-1920.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/07\/programming-1920.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":3710,"url":"https:\/\/felipemateus.com\/en\/blog\/2021\/11\/sonoff-keyboard-key-reuse","url_meta":{"origin":4097,"position":2},"title":"sonoff: Keyboard key reuse","author":"Felipe Mateus","date":"21\/11\/2021","format":false,"excerpt":"In this text I show a homemade project that I created that allows activating the sonoff through the computer keyboard.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"imagem capa para temas iot.","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":3663,"url":"https:\/\/felipemateus.com\/en\/blog\/2021\/10\/iptv-customer-manager","url_meta":{"origin":4097,"position":3},"title":"IPTV Customer Manager","author":"Felipe Mateus","date":"15\/10\/2021","format":false,"excerpt":"Customer management package, plans and customer channel list. Learn more about iptv-customers.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/10\/image_2021-10-15_00-34-26.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/10\/image_2021-10-15_00-34-26.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/10\/image_2021-10-15_00-34-26.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/10\/image_2021-10-15_00-34-26.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/10\/image_2021-10-15_00-34-26.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":13381,"url":"https:\/\/felipemateus.com\/en\/blog\/2025\/07\/fuck-wordpress","url_meta":{"origin":4097,"position":4},"title":"\ud83d\udeab Fuck WordPress \ud83d\udeab","author":"Felipe Mateus","date":"17\/07\/2025","format":false,"excerpt":"A year after being banned from WordPress.org, I realized that the problem was never me. The community is toxic, centralized, and full of mediocre people protected by power structures. I abandoned plugin development and am now searching for a real alternative.","rel":"","context":"In &quot;Plataformas e Privacidade&quot;","block_context":{"text":"Plataformas e Privacidade","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/platforms-and-privacy"},"img":{"alt_text":"wordpress logo forbidden","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/07\/wordpress-logo-forbidden.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/07\/wordpress-logo-forbidden.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/07\/wordpress-logo-forbidden.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/07\/wordpress-logo-forbidden.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/07\/wordpress-logo-forbidden.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/07\/wordpress-logo-forbidden.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":9060,"url":"https:\/\/felipemateus.com\/en\/blog\/2023\/09\/sonoff-keyboard-key-reuse-background","url_meta":{"origin":4097,"position":5},"title":"sonoff: Keyboard key reuse \u2013 Part 2","author":"Felipe Mateus","date":"03\/09\/2023","format":false,"excerpt":"This project is part of the second part of the &#039;Keyboard Key Reuse&#039; project. In it, I develop a program that allows you to turn the light on and off using a keyboard shortcut. In this new version, the program runs as a service in the background.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"imagem capa para temas iot.","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts\/4097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/comments?post=4097"}],"version-history":[{"count":27,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts\/4097\/revisions"}],"predecessor-version":[{"id":66822,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts\/4097\/revisions\/66822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/media\/4120"}],"wp:attachment":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/media?parent=4097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/categories?post=4097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/tags?post=4097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}