{"id":121884,"date":"2025-01-28T11:34:46","date_gmt":"2025-01-28T11:34:46","guid":{"rendered":"\/tutorials\/?p=121884"},"modified":"2025-12-18T22:44:12","modified_gmt":"2025-12-18T22:44:12","slug":"laravel-commands","status":"publish","type":"post","link":"\/my\/tutorials\/sell-vintage-clothing-online-15","title":{"rendered":"Laravel commands: Top Artisan commands to know and how to create them"},"content":{"rendered":"<p><strong>Laravel<\/strong> is celebrated for its clean architecture and developer-friendly approach to web development. Yet, even in such a well-designed framework, tasks like creating files, managing databases, or debugging can slow you down.<\/p><p>That&rsquo;s where <strong>Laravel Artisan<\/strong> comes in. This powerful command-line interface tool simplifies and automates these tasks, freeing you to focus on building exceptional features and delivering high-quality applications.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-getting-started-with-laravel-artisan\">Getting started with Laravel Artisan<\/h2><p>Laravel Artisan<strong> <\/strong>is the out-of-the-box command-line interface included in <a href=\"\/my\/tutorials\/laravel-tutorial\">Laravel<\/a>. It provides developers with a comprehensive suite of commands to generate code, manage databases, and optimize applications. By automating these tasks, Artisan helps you save time, maintain consistency, and streamline your workflows across projects.<\/p><p>Artisan works by using terminal commands, which allow you to interact with your Laravel project directly from the command line. Instead of manual actions, Artisan enables writing console commands that handle everything from scaffolding new code to performing maintenance tasks, making it an essential part of a Laravel developer&rsquo;s toolkit.<\/p><h3 class=\"wp-block-heading\" id=\"h-starting-out-with-artisan-commands\">Starting out with Artisan commands<\/h3><p>Follow these steps to get started:<\/p><ol class=\"wp-block-list\">\n<li>Check if Laravel is installed. To do so, open your command line interface and run the following command:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan<\/pre><p>If Laravel is installed, this will return a list of all available Artisan commands:<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e07440bc8ef\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"334\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/01\/php_artisan_command-1024x334.png\" alt=\"List of the available Artisan commands in Laravel\" class=\"wp-image-121887\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command-1024x334.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command-300x98.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command-150x49.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command-768x250.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command.png 1460w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>If the command throws an error, you will need to <a href=\"\/my\/tutorials\/how-to-install-laravel-on-ubuntu\">set up Laravel<\/a> first.<\/p><ol start=\"2\" class=\"wp-block-list\">\n<li>Navigate to the folder that hosts your Laravel project:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd path-to-your-project<\/pre><p>Change path-to-your-project with the actual path of your Laravel project.<\/p><ol start=\"3\" class=\"wp-block-list\">\n<li>Run the<strong> <\/strong>php artisan list command to see a list of all the commands you can use. Each command comes with a short description explaining what it does.<\/li>\n\n\n\n<li>Run any Artisan command by typing php artisan followed by the command name. For example, this command will spin up a local development server:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan serve&nbsp;<\/pre><p>You can add the &ndash;help flag to any command to view the information about a command, including its description and the command parameters:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan [command-name] --help<\/pre><h2 class=\"wp-block-heading\" id=\"h-top-laravel-artisan-commands\">Top Laravel Artisan commands<\/h2><h3 class=\"wp-block-heading\" id=\"h-core-commands\">Core commands<\/h3><p>These commands allow you to efficiently set up the main components of your application, saving you from manually creating boilerplate code:<\/p><ul class=\"wp-block-list\">\n<li><strong>Generate a new model class to represent a database table.<\/strong> Create models for interacting with database records, such as products, users, or orders.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:model [ModelName]<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new controller class. <\/strong>Create controllers for managing user input and handling actions like logging in or updating profiles.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:controller [ControllerName]<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new form request validation class.<\/strong> Handle form validation logic in a clean and reusable way, such as validating user registration input.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:request [RequestName]<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new resource class for transforming data in API responses.<\/strong> Format and structure data when building APIs, such as defining how user details should be returned.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:resource [ResourceName]<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new factory class for generating fake data.<\/strong> Create factories for testing purposes, such as generating fake product or user data for testing features.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:factory [FactoryName]<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new database seeder class.<\/strong> Create seeders for populating your database with test data, such as creating a list of sample users or products.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:seeder [SeederName]<\/pre><h3 class=\"wp-block-heading\" id=\"h-development-and-setup-commands\">Development and setup commands<\/h3><p>These commands streamline the process of configuring your Laravel application, helping you manage databases, enforce request handling rules, and organize your project efficiently:<\/p><ul class=\"wp-block-list\">\n<li><strong>Start a local development server for your Laravel application.<\/strong> If no input value is provided for the options such as host or port, it defaults to<strong> <\/strong><strong>127.0.0.1:8000.<\/strong><\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan serve --host=[IP] --port=[port]<\/pre><ul class=\"wp-block-list\">\n<li><strong>Apply all pending migrations to update your database schema. <\/strong>Make changes to your database, like adding tables or modifying columns, without manually writing SQL.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan migrate<\/pre><ul class=\"wp-block-list\">\n<li><strong>Drop all tables and re-run all migrations.<\/strong>Reset your database during development, ensuring a clean slate for testing or rebuilding your schema.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan migrate:fresh<\/pre><ul class=\"wp-block-list\">\n<li><strong>Execute database seeders to populate tables with sample data. <\/strong>Fill your database with test data, such as creating sample users or products for testing purposes.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan db:seed<\/pre><ul class=\"wp-block-list\">\n<li><strong>Roll back the most recent batch of migrations.<\/strong> Undo recent changes to your database schema, such as removing a newly created table during testing.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan migrate:rollback<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new middleware class.<\/strong> Define middleware for tasks like verifying user authentication or restricting access to certain routes.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:middleware<\/pre><ul class=\"wp-block-list\">\n<li><strong>Create a symbolic link from the storage directory to the public directory.<\/strong> Make files in your own storage location accessible from the web, such as user-uploaded images.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan storage:link<\/pre><ul class=\"wp-block-list\">\n<li><strong>Generate a new policy class for managing authorization logic.<\/strong> Implement rules for user actions, such as defining who can update or delete a specific resource.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:policy [PolicyName]<\/pre><h3 class=\"wp-block-heading\" id=\"h-debugging-and-testing-commands\">Debugging and testing commands<\/h3><p>These commands act as tools to diagnose problems, allow interaction with the application in real-time, and verify that everything functions as intended, ensuring a smoother development process:<\/p><ul class=\"wp-block-list\">\n<li><strong>Display a list of all registered routes in the application. <\/strong>Review all available routes, including their HTTP methods, URIs, and associated controllers, which is helpful for debugging routing issues.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan route:list<\/pre><ul class=\"wp-block-list\">\n<li><strong>Open an interactive REPL (Read-Eval-Print Loop) for your Laravel application. <\/strong>Interact with your application directly, test queries, or debug logic without modifying your codebase.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan tinker<\/pre><ul class=\"wp-block-list\">\n<li><strong>Run all PHPUnit or Pest tests in your application.<\/strong> Validate your application&rsquo;s functionality and ensure that features are working as intended before deploying.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan test<\/pre><ul class=\"wp-block-list\">\n<li><strong>Display the current application environment (e.g., local, staging, or production).<\/strong> Verify the environment your application is running in, which is useful for debugging configuration issues.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan env<\/pre><ul class=\"wp-block-list\">\n<li><strong>Clear all cached configuration files.<\/strong> Force the application to reload configuration settings after changes are made.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan config:clear<\/pre><ul class=\"wp-block-list\">\n<li><strong>Clear all cached view files.<\/strong> Resolve issues caused by outdated templates or compiled views after updating your Blade files.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan view:clear<\/pre><h3 class=\"wp-block-heading\" id=\"h-optimization-and-deployment-commands\">Optimization and deployment commands<\/h3><p>These commands help ensure your application is fast, reliable, and ready for production while also providing tools to manage downtime during updates:<\/p><ul class=\"wp-block-list\">\n<li><strong>Optimize your application by caching routes, views, and configuration files.<\/strong> Use this command before deploying your application to enhance performance by reducing runtime overhead.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan optimize<\/pre><ul class=\"wp-block-list\">\n<li><strong>Cache your configuration files for faster access.<\/strong> Speed up the loading of configuration settings in the production environments.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan config:cache<\/pre><ul class=\"wp-block-list\">\n<li><strong>Cache all registered routes. <\/strong>Improve performance by reducing the time it takes to load routes during runtime.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan route:cache<\/pre><ul class=\"wp-block-list\">\n<li><strong>Compile all Blade view files into cache.<\/strong> Precompile views and ensure faster rendering in production.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan view:cache<\/pre><ul class=\"wp-block-list\">\n<li><strong>Clear the application cache.<\/strong> Refresh the cache when changes aren&rsquo;t reflected in your application.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan cache:clear<\/pre><ul class=\"wp-block-list\">\n<li><strong>Process jobs from the queue.<\/strong> Handle queued tasks, such as sending emails or processing file uploads.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan queue:work<\/pre><ul class=\"wp-block-list\">\n<li><strong>Put the application into maintenance mode. <\/strong>Use this before deploying updates to prevent users from accessing the application during maintenance.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan down<\/pre><ul class=\"wp-block-list\">\n<li><strong>Bring the application out of maintenance mode.<\/strong> Restore user access after maintenance tasks are completed.<\/li>\n<\/ul><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan up<\/pre><p>This is not an extensive list of all Artisan commands, as there are many more. However, these commands will likely be the main ones you interact with while using Laravel.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/my\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-creating-custom-laravel-artisan-commands\">Creating custom Laravel Artisan commands<\/h2><p>While built-in Artisan commands cover many scenarios, there are times when your project requires more specific functionality. Custom commands allow you to extend Laravel&rsquo;s capabilities, turning repetitive or complex processes into reusable tools.<\/p><p>Some examples of when custom commands are particularly useful include:<\/p><ul class=\"wp-block-list\">\n<li><strong>Automating repetitive jobs<\/strong>: You can automate manual tasks like deleting old records, cleaning up unused files, or resetting system data, and focus your time where it matters.<\/li>\n\n\n\n<li><strong>Managing complex processes<\/strong>: You can streamline multi-step workflows, such as data imports, scheduled maintenance tasks, or generating backups with a single command.<\/li>\n\n\n\n<li><strong>Creating tools for specific needs<\/strong>: Custom commands are as flexible as you make them, so you can always make them fit your use case.<\/li>\n<\/ul><p>Custom Artisan commands allow you to turn unique application needs into efficient, maintainable, and easily executable solutions, making your development process more streamlined and scalable.<\/p><p>Let&rsquo;s break down the process of creating a custom Artisan command, from generating the file to testing it in your application.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-generate-a-new-command\">1. Generate a new command<\/h3><p>To create a new command for Artisan, we start by generating the command file. Artisan has a helpful command to make this file quickly:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan make:command MyCustomCommand<\/pre><p>This will create a new file with a name matching the one you specified in the <strong>app\/console\/commands<\/strong> directory. For example, running the command above generates a file named <strong>MyCustomCommand.php<\/strong>.<\/p><p>Here&rsquo;s how the generated new command class looks like:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">namespace App\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\n\nclass MyCustomCommand extends Command\n{\n&nbsp; &nbsp; \/**\n&nbsp; &nbsp; * The name and signature of the console command.\n&nbsp; &nbsp; *\n&nbsp; &nbsp; * @var string\n&nbsp; &nbsp; *\/\n&nbsp; &nbsp; protected $signature = 'command:name';\n\n&nbsp; &nbsp; \/**\n&nbsp; &nbsp; * The console command description.\n&nbsp; &nbsp; *\n&nbsp; &nbsp; * @var string\n&nbsp; &nbsp; *\/\n&nbsp; &nbsp; protected $description = 'Command description';\n\n&nbsp; &nbsp; \/**\n&nbsp; &nbsp; * Execute the console command.\n&nbsp; &nbsp; *\n&nbsp; &nbsp; * @return int\n&nbsp; &nbsp; *\/\n&nbsp; &nbsp; public function handle()\n&nbsp; &nbsp; {\n&nbsp; &nbsp; &nbsp; &nbsp; \/\/\n&nbsp; &nbsp; }\n}<\/pre><p>This file provides the structure you need to define your custom command. Here&rsquo;s a quick breakdown of the key properties in the generated command class:<\/p><ul class=\"wp-block-list\">\n<li><strong>$signature<\/strong>: Specifies the name of the command that you&rsquo;ll use in the command line interface. You can also define input arguments and options here and assign default values to them.<\/li>\n\n\n\n<li><strong>$description<\/strong>: Provides a short explanation of what the command does. This is what you will see when you run<strong> <\/strong>php artisan list<strong> <\/strong>or<strong> <\/strong>php artisan help<strong>.<\/strong><\/li>\n\n\n\n<li><strong>handle()<\/strong>: Contains the custom command logic. This is where you define the task the command will perform.<\/li>\n<\/ul><h3 class=\"wp-block-heading\" id=\"h-2-define-command-properties\">2. Define command properties<\/h3><p>After generating your command, the next step is to give it a name, define any arguments or options it needs, and describe what it does. These are set in the <strong>$signature<\/strong> and <strong>$description<\/strong> properties.<\/p><p>In this example, we&rsquo;ll create a command that sends a notification to a user:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected $signature = 'user:notify {user_id} {--force}';\nprotected $description = 'Send a notification to a specific user, with an optional force flag';<\/pre><p><strong>Syntax for Defining Arguments and Options<\/strong><\/p><ul class=\"wp-block-list\">\n<li><strong>Arguments: <\/strong><strong>{argument_name}<\/strong>\n<ul class=\"wp-block-list\">\n<li>Define required inputs for your command. Arguments are mandatory unless wrapped in square brackets <strong>([ ])<\/strong>, making them optional.<\/li>\n\n\n\n<li><strong>Example: <\/strong>{user_id} requires a value like <strong>42<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Options: <\/strong><strong>{&ndash;option_name}<\/strong>\n<ul class=\"wp-block-list\">\n<li>Define optional inputs or flags to alter how the command behaves. You can also specify values for options using =.<\/li>\n\n\n\n<li><strong>Example: <\/strong><strong>{&ndash;type=}<\/strong> allows you to pass an optional value (e.g., <strong>&ndash;type=email<\/strong>).<\/li>\n<\/ul>\n<\/li>\n<\/ul><p>Setting these properties properly makes your command intuitive and effective in fulfilling its purpose.<\/p><h3 class=\"wp-block-heading\" id=\"h-3-implement-the-handle-method\">3. Implement the handle() method<\/h3><p>The <strong>handle()<\/strong> method defines the core functionality of your custom command. This code runs every time the command is executed, making it the heart of your command&rsquo;s functionality.<\/p><p>In our notification command example, here&rsquo;s how the <strong>handle()<\/strong> method could look:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public function handle()\n{\n&nbsp; &nbsp; \/\/ Step 1: Retrieve argument and option method values\n&nbsp; &nbsp; $userId = $this-&gt;argument('user_id'); \/\/ Get the user_id argument\n&nbsp; &nbsp; $force = $this-&gt;option('force'); &nbsp; &nbsp; \/\/ Check if the --force option is used\n\n&nbsp; &nbsp; \/\/ Step 2: Validate input\n&nbsp; &nbsp; $user = User::find($userId); &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Find the user by ID\n&nbsp; &nbsp; if (!$user) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Handle missing user\n&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;error('User not found!'); \/\/ Write error message text\n&nbsp; &nbsp; &nbsp; &nbsp; return Command::FAILURE; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Exit with failure exit code\n&nbsp; &nbsp; }\n\n&nbsp; &nbsp; \/\/ Step 3: Confirm action (if --force is not used)\n&nbsp; &nbsp; if (!$force &amp;&amp; !$this-&gt;confirm('Do you really want to notify this user?')) {\n&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;info('Command cancelled.');\n&nbsp; &nbsp; &nbsp; &nbsp; return Command::SUCCESS; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Exit cleanly as no error occurred\n&nbsp; &nbsp; }\n\n&nbsp; &nbsp; \/\/ Step 4: Perform the task\n&nbsp; &nbsp; Notification::send($user, new CustomNotification()); \/\/ Send the notification\n\n&nbsp; &nbsp; \/\/ Step 5: Exit gracefully\n&nbsp; &nbsp; $this-&gt;info('Notification sent successfully!');&nbsp; &nbsp; &nbsp; \/\/ Provide success feedback\n&nbsp; &nbsp; return Command::SUCCESS; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Exit with successful exit code\n}<\/pre><p><strong>Step-by-step breakdown:<\/strong><\/p><ol class=\"wp-block-list\">\n<li><strong>Retrieve argument and option method values. <\/strong>The command retrieves the user supplied arguments and options for your command.<\/li>\n\n\n\n<li><strong>Validate input. <\/strong>Using <strong>User::find($userId)<\/strong>, the command checks if the specified user exists. If not, it outputs an error message through the error method and exits with <strong>Command::FAILURE<\/strong>.<\/li>\n\n\n\n<li><strong>Confirm action. <\/strong>Unless the <strong>&ndash;force<\/strong> flag is provided, the command prompts the user to confirm whether they want to proceed using the confirm method<strong> <\/strong><strong>$this-&gt;confirm()<\/strong>.<\/li>\n\n\n\n<li><strong>Perform the task. <\/strong>The <strong>Notification::send()<\/strong> method is used to notify the specified user.<\/li>\n\n\n\n<li><strong>Exit gracefully. <\/strong>The command outputs a success message using <strong>$this-&gt;info()<\/strong> and exits with <strong>Command::SUCCESS<\/strong>.<\/li>\n<\/ol><p>And now we have the entire Artisan command defined, just about ready for use.<\/p><h3 class=\"wp-block-heading\" id=\"h-4-register-the-command\">4. Register the command<\/h3><p>After creating your custom command, you need to ensure it&rsquo;s registered in Laravel so it can be executed. Laravel automatically registers commands stored in the <strong>app\/Console\/Commands<\/strong> directory. To confirm this, you can run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan list<\/pre><p>If your command appears in the list, it&rsquo;s already registered. However, if your command is stored elsewhere or doesn&rsquo;t appear in the list, you&rsquo;ll need to register it manually in the <strong>Kernel.php<\/strong><strong> <\/strong>file.<\/p><p>The <strong>Kernel<\/strong><strong> <\/strong>file, located in the <strong>app\/Console<\/strong> directory, is a PHP file that acts as the central hub for managing Artisan commands. It tells Laravel which commands to load and ensures they are ready for use.<\/p><p>Beyond registering commands, <strong>Kernel.php<\/strong> also manages task scheduling, making it an essential part of your application&rsquo;s command-line operations.<\/p><p><strong>Registering your custom command manually<\/strong><\/p><ol class=\"wp-block-list\">\n<li>Navigate to the <strong>app\/Consol<\/strong>e directory in your Laravel project and open the <strong>Kernel.php<\/strong> file in your code editor. This file is where you&rsquo;ll register any custom commands not detected automatically.<\/li>\n\n\n\n<li>Inside the <strong>Kernel<\/strong><strong> <\/strong>class, find the <strong>commands()<\/strong> method. This method is where Laravel expects a list of manually registered commands. By default, it looks like this:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected function commands()\n&nbsp; &nbsp; {\n&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;load(__DIR__.'\/Commands');\n\n&nbsp; &nbsp; &nbsp; &nbsp; require base_path('routes\/console.php');\n&nbsp; &nbsp; }<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Add the fully qualified class name of your custom command to the command method. For example:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected function commands()\n{\n&nbsp; &nbsp; $this-&gt;load(__DIR__.'\/Commands');\n\n&nbsp; &nbsp; \/\/ Explicitly register a command\n&nbsp; &nbsp; $this-&gt;commands([\n&nbsp; &nbsp; &nbsp; &nbsp; \\App\\Console\\Commands\\MyCustomCommand::class,\n&nbsp; &nbsp; ]);\n\n&nbsp; &nbsp; require base_path('routes\/console.php');\n}<\/pre><ul class=\"wp-block-list\">\n<li>Ensure the namespace matches the location of your command. If your command is stored in a custom directory, update the namespace accordingly.<\/li>\n<\/ul><p>\n\n\n\n<div><p class=\"important\"><strong>Important!<\/strong> Ensure that your class name defined in your custom command and your file name match. If they do not, Laravel&rsquo;s autoloader won&rsquo;t detect your command properly!<\/p><\/div>\n\n\n\n<\/p><ol start=\"4\" class=\"wp-block-list\">\n<li>After adding your command, save the <strong>Kernel.php<\/strong> file to apply your changes.<\/li>\n\n\n\n<li>Run the <strong>php artisan list<\/strong> command to list every existing artisan command, then look for your command&rsquo;s name and description in the output:<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e07440bf6b9\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"128\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/01\/php_artisan_command_list-1024x128.png\" alt=\"Looking for the command name and description in the php artisan list\" class=\"wp-image-121886\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command_list-1024x128.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command_list-300x38.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command_list-150x19.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command_list-768x96.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2025\/01\/php_artisan_command_list.png 1460w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>If your command doesn&rsquo;t appear in the list after saving your changes, you may need to clear your cache by running <strong>php artisan optimize:clear<\/strong>.<\/p><h3 class=\"wp-block-heading\" id=\"h-5-run-and-test-the-custom-command\">5. Run and test the custom command<\/h3><p>Testing your custom command ensures it functions as intended and handles different scenarios correctly. Follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Execute your custom command in the terminal as you defined it. In our example, that would look like this:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan user:notify 42<\/pre><p>Replace <strong>42 <\/strong>with a valid user ID to see if it works under the intended circumstances.<\/p><ol start=\"2\" class=\"wp-block-list\">\n<li>If you have optional flags defined, run the command when using them to see if the behavior changes. In our example:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan user:notify 42 --force<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Check if the expected task you defined in your <strong>handle()<\/strong> method is completed.<\/li>\n\n\n\n<li>Check if the terminal is accurately displaying output based on what you defined.<\/li>\n\n\n\n<li>Check for invalid inputs to see if your command handles errors gracefully. For example, we could try a non-existent user ID:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan user:notify 99999<\/pre><p>Based on our<strong> <\/strong><strong>handle()<\/strong> method, this should return the error <strong>User not found!<\/strong><\/p><p>Be sure to test your command thoroughly, especially in scenarios that mimic its intended real-world usage. Extensive testing ensures your command is reliable and meets the needs of your application.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Laravel Artisan is an essential tool for every Laravel developer. It helps you automate tasks, manage workflows, and simplify complex processes. Its built-in commands streamline development, while custom commands enable you to solve problems unique to your application.<\/p><p>By mastering Artisan, you&rsquo;ll not only save time but also improve the quality and consistency of your code.<\/p><h2 class=\"wp-block-heading\" id=\"h-laravel-commands-faq\">Laravel commands FAQ<\/h2><div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-694483bce0a72\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What are common Laravel commands?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Some commands are <strong>php artisan make:model ModelName<\/strong>, which creates a new model, <strong>php artisan migrate<\/strong>, which runs migrations and <strong>php artisan route:list<\/strong>, which lists all the routes in your application.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-694483bce0a74\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">How do I create a new Laravel project using the command line?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>You can use Composer to create a new Laravel project. An example command could be <strong>composer create-project laravel\/laravel project-name<\/strong>, where project-name would be the name of your Laravel application.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-694483bce0a75\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What is the command to run migrations in Laravel?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>To run migrations in Laravel, use <strong>php artisan migrate<\/strong>. This command applies all pending migrations to your database, creating or updating tables as defined in your migration files.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Laravel is celebrated for its clean architecture and developer-friendly approach to web development. Yet, even in such a well-designed framework, tasks like creating files, managing databases, or debugging can slow you down. That&rsquo;s where Laravel Artisan comes in. This powerful command-line interface tool simplifies and automates these tasks, freeing you to focus on building exceptional [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/sell-vintage-clothing-online-15\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":515,"featured_media":121895,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Laravel commands and how to create custom Artisan commands","rank_math_description":"Laravel Artisan is a powerful CLI tool for building apps. Learn essential commands and how to create custom commands with practical examples.","rank_math_focus_keyword":"laravel commands","footnotes":""},"categories":[22641,22639],"tags":[],"class_list":["post-121884","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/laravel-commands","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/laravel-commands","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/laravel-commands","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/laravel-commands","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/laravel-commands","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/laravel-commands","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/laravel-commands","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/laravel-commands","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/121884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/515"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=121884"}],"version-history":[{"count":20,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/121884\/revisions"}],"predecessor-version":[{"id":125998,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/121884\/revisions\/125998"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media\/121895"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=121884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=121884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=121884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}