October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

5 Laravel Artisan Commands for Everyday Development

Five Laravel Artisan commands cover most routine development work: discovering commands, inspecting routes, generating a model with its migration, running migrations, and exploring the app with Tinker.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Five Artisan commands cover most routine work in a Laravel project: listing what the application can do, inspecting routes, generating a model with its migration, running pending migrations, and exploring live application code with Tinker. This guide explains when each one helps and what it can change. The list follows the workflow Laravel’s own documentation describes. It is not a record of how often any particular developer runs these commands.

Check your version and environment first

Command options and available commands can differ between Laravel releases. The syntax below is checked against the Laravel 13.x Artisan documentation. Before you run anything, confirm which version your project uses:

As an Amazon Associate I earn from qualifying purchases.

php artisan --version

If the output shows an older release, read the matching documentation for that version. Run php artisan help <command> at any time to see the options your installed version accepts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If your local environment runs through Laravel Sail, prefix every command with the Sail wrapper. Laravel’s documentation states: “If you are using Laravel Sail as your local development environment, remember to use the sail command line to invoke Artisan commands.” The documented example is:

./vendor/bin/sail artisan list

The examples in this article use plain php artisan. For Sail, substitute ./vendor/bin/sail artisan.

The five commands

Laravel’s documentation describes Artisan as “the command line interface included with Laravel.” It lives at the root of every application as the artisan script. Each command below covers one task, followed by the main thing to watch for.

1. php artisan list: discover what the application can do

Run this when you open an unfamiliar project, or when you cannot remember the name of a command. It prints every command available in the current application, including commands added by installed packages.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
php artisan list

To see the arguments and options for a single command, pass its name to help:

php artisan help migrate

This command only reads information. It does not touch the database or the filesystem.

2. php artisan route:list: inspect registered routes

This command prints a table of the routes your application has registered, which is the quickest way to confirm that a route exists and points where you expect. It is most useful after adding a route file or a controller, or when a URL returns an unexpected response.

php artisan route:list

The routing documentation describes this command as an overview of routes and notes options for narrowing the output, such as filtering by path or showing middleware. Those option names have changed across releases. The routing documentation available for this article covers Laravel 10.x, so run php artisan help route:list in your project to confirm which filters and verbosity flags your version supports before relying on them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In a large application the table can run long. Pipe the output through a search tool or use a path filter rather than scanning every row.

3. php artisan make:model Flight -m: scaffold a model and its migration together

The make:model command generates an Eloquent model class. Adding -m (or the longer --migration) also generates a database migration for the model’s table. “Flight” is only an example name. Replace it with a singular, StudlyCase name that matches your domain, such as Invoice or Subscription.

php artisan make:model Flight -m

Expect two new files:

  • app/Models/Flight.php, the model class.
  • A timestamped file in database/migrations/ whose name ends in create_flights_table.php. Its up() method is where you define the table’s columns.

The migration is not applied yet. Nothing changes in your database until you run migrate, so review the columns first.

4. php artisan migrate: run pending database migrations

This command applies every migration that has not yet run against the database configured in your .env file. It is the normal step after you create or edit a migration during local development.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
php artisan migrate

Treat this as a development step, not a routine production deployment step. Running it against a production database changes live schema, and some changes cannot be reversed without data loss. Take a backup, review the pending migrations, and confirm that your deployment process is set up for this before running anything in production.

Laravel includes a safeguard for production environments: when APP_ENV is set to production, the command asks for confirmation. The --force flag skips that prompt. Use it only when you have made a deliberate decision to run the migrations, and check the current migration documentation for your version before relying on this behavior.

5. php artisan tinker: explore the running application

Tinker is a REPL, a read-evaluate-print loop, powered by PsySH. Laravel describes it as a way to interact with the application, including Eloquent models, jobs, and events. Use it to check a query, test a model relationship, or confirm what a helper returns.

php artisan tinker
>>> AppModelsFlight::count()

Tinker runs real code against the database your application is configured to use. It is not a sandbox. A call such as AppModelsFlight::truncate() removes every row immediately, with no undo. Read-only queries are the safe default. Before you write or delete anything in a session, confirm which database the session connects to.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Tinker’s default command allow list includes migrate, so the migration command can also be invoked from inside a session. That is one more reason to keep Tinker away from production data unless you have a specific reason to be there.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Side-by-side: what each command changes

Command Main task Changes files or data? Main caution
php artisan list Discover available commands No None for normal use
php artisan route:list Inspect registered routes No Output can be long in large applications; check option names for your version
php artisan make:model Flight -m Generate a model and migration Creates new files in the project Generated files do nothing until you migrate, so review the migration first
php artisan migrate Apply pending migrations Changes the database schema Back up first; production requires deliberate confirmation
php artisan tinker Run PHP against the application interactively Can, if the code writes or deletes Code runs against the configured database; confirm the connection before writing

A typical local sequence

The commands fit together in a single workflow. Here is one common order for adding a new table in local development:

  1. Run php artisan list or php artisan help make:model if you need to confirm options.
  2. Run php artisan make:model Flight -m to create the model and migration.
  3. Edit the migration in database/migrations/ and define the columns.
  4. Run php artisan migrate to create the table locally.
  5. Run php artisan route:list if the change involves routes, then php artisan tinker to check the new model with a read-only query.

Keep this sequence on your local machine or a staging copy. Production changes need their own review and deployment steps.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.