- Usage:

command [options] [arguments]


- Options:

  • -h, --help - Display help for the given command. When no command is given display help for the list command.
  • -q, --quiet - Do not output any message.
  • -V, --version - Display this application version.
  • -n, --no-interaction - Do not ask any interactive question.

clear-compiled

php artisan clear-compiled

Remove the compiled class file.


db

php artisan db mysql

Start a new database CLI session.

Options:

  • --read - Connect to the read connection.
  • --write - Connect to the write connection.

down

php artisan down

Put the application into maintenance / demo mode.

Options:

  • --redirect[=REDIRECT] - The path that users should be redirected to.
  • --render[=RENDER] - The view that should be prerendered for display during maintenance mode.
  • --retry[=RETRY] - The number of seconds after which the request may be retried.
  • --refresh[=REFRESH] - The number of seconds after which the browser may refresh.
  • --secret[=SECRET] - The secret phrase that may be used to bypass maintenance mode.
  • --status[=STATUS] - The status code that should be used when returning the maintenance mode response [default: "503"].

env

php artisan env

Display the current framework environment.


help

php artisan help list

Display help for a command.

Options:

  • --format=FORMAT - The output format (txt, xml, json, or md) [default: "txt"].
  • --raw - To output raw command help.

inspire

php artisan inspire

Display an inspiring quote.


list

php artisan list

List commands.

Options:

  • --raw - To output raw command list.
  • --format=FORMAT - The output format (txt, xml, json, or md) [default: "txt"].
  • --short - To skip describing commands arguments.

Arguments:

  • namespace - The namespace name.

migrate

php artisan migrate

Run the database migrations.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --force - Force the operation to run when in production.
  • --path[=PATH] - The path(s) to the migrations files to be executed (multiple values allowed).
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.
  • --schema-path[=SCHEMA-PATH] - The path to a schema dump file.
  • --pretend - Dump the SQL queries that would be run.
  • --seed - Indicates if the seed task should be re-run.
  • --step - Force the migrations to be run so they can be rolled back individually.

optimize

php artisan optimize

Cache the framework bootstrap files.


serve

php artisan serve

Serve the application on the PHP development server.

Options:

  • --host[=HOST] - The host address to serve the application on [default: "127.0.0.1"].
  • --port[=PORT] - The port to serve the application on.
  • --tries[=TRIES] - The max number of ports to attempt to serve from [default: 10].
  • --no-reload - Do not reload the development server on .env file changes.

test

php artisan test

Run the application tests.

Options:

  • --without-tty - Disable output to TTY.
  • -p, --parallel - Indicates if the tests should run in parallel.
  • --recreate-databases - Indicates if the test databases should be re-created.

tinker

php artisan tinker

Interact with your application.

Options:

  • --execute[=EXECUTE] - Execute the given code using Tinker.

Arguments:

  • include - Include file(s) before starting tinker.

up

php artisan up

Bring the application out of maintenance mode.


auth:clear-resets

php artisan auth:clear-resets

Flush expired password reset tokens.

Arguments:

  • name - The name of the password broker.

cache:clear

php artisan cache:clear

Flush the application cache.

Options:

  • --tags[=TAGS] - The cache tags you would like to clear.

Arguments:

  • store - The name of the store you would like to clear.

cache:forget

php artisan cache:forget

Remove an item from the cache.

Arguments:

  • key - The key to remove.
  • store - The store to remove the key from.

cache:table

php artisan cache:table

Create a migration for the cache database table.


config:cache

php artisan config:cache

Create a cache file for faster configuration loading.


config:clear

php artisan config:clear

Remove the configuration cache file.


db:seed

php artisan db:seed

Seed the database with records.

Options:

  • --class[=CLASS] - The class name of the root seeder [default: "Database\Seeders\DatabaseSeeder"].
  • --database[=DATABASE] - The database connection to seed.
  • --force - Force the operation to run when in production.

Arguments:

  • class - The class name of the root seeder.

db:wipe

php artisan db:wipe

Drop all tables, views, and types.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --drop-views - Drop all tables and views.
  • --drop-types - Drop all tables and types (Postgres only).
  • --force - Force the operation to run when in production.

event:cache

php artisan event:cache

Discover and cache the application's events and listeners.


event:clear

php artisan event:clear

Clear all cached events and listeners.


event:generate

php artisan event:generate

Generate the missing events and listeners based on registration.


event:list

php artisan event:list

List the application's events and listeners.

Options:

  • --event[=EVENT] - Filter the events by name.

key:generate

php artisan key:generate

Set the application key.

Options:

  • --show - Display the key instead of modifying files.
  • --force - Force the operation to run when in production.

make:cast

php artisan make:cast MyCast

Create a new custom Eloquent cast class.

Arguments:

  • name - The name of the class.

make:channel

php artisan make:channel MyChannel

Create a new channel class.

Arguments:

  • name - The name of the class.

make:command

php artisan make:command MyCommand

Create a new Artisan command.

Options:

  • --command[=COMMAND] - The terminal command that should be assigned [default: "command:name"].

Arguments:

  • name - The name of the command.

make:component

php artisan make:component MyComponent

Create a new view component class.

Options:

  • --force - Create the class even if the component already exists.
  • --inline - Create a component that renders an inline view.

Arguments:

  • name - The name of the class.

make:controller

php artisan make:controller MyController

Create a new controller class.

Options:

  • --api - Exclude the create and edit methods from the controller.
  • --type=TYPE - Manually specify the controller stub file to use.
  • --force - Create the class even if the controller already exists.
  • -i, --invokable - Generate a single method, invokable controller class.
  • -m, --model[=MODEL] - Generate a resource controller for the given model.
  • -p, --parent[=PARENT] - Generate a nested resource controller class.
  • -r, --resource - Generate a resource controller class.

Arguments:

  • name - The name of the class.

make:event

php artisan make:event MyEvent

Create a new event class.

Arguments:

  • name - The name of the class.

make:exception

php artisan make:exception MyException

Create a new custom exception class.

Options:

  • --render - Create the exception with an empty render method.
  • --report - Create the exception with an empty report method.

Arguments:

  • name - The name of the class.

make:factory

php artisan make:factory MyFactory

Create a new model factory.

Options:

  • -m, --model[=MODEL] - The name of the model.

Arguments:

  • name - The name of the class.

make:job

php artisan make:job MyJob

Create a new job class.

Options:

  • --sync - Indicates that job should be synchronous.

Arguments:

  • name - The name of the class.

make:listener

php artisan make:listener MyListener

Create a new event listener class.

Options:

  • -e, --event[=EVENT] - The event class being listened for.
  • --queued - Indicates the event listener should be queued.

Arguments:

  • name - The name of the class.

make:mail

php artisan make:mail MyMail

Create a new email class.

Options:

  • -f, --force - Create the class even if the mailable already exists.
  • -m, --markdown[=MARKDOWN] - Create a new Markdown template for the mailable.

Arguments:

  • name - The name of the class.

make:middleware

php artisan make:middleware MyMiddleware

Create a new middleware class.

Arguments:

  • name - The name of the class.

make:migration

php artisan make:migration create_news_table

Create a new migration file.

Options:

  • --create[=CREATE] - The table to be created.
  • --table[=TABLE] - The table to migrate.
  • --path[=PATH] - The location where the migration file should be created.
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.
  • --fullpath - Output the full path of the migration.

Arguments:

  • name - The name of the migration.

make:model

php artisan make:model Post

Create a new Eloquent model class.

Options:

  • -a, --all - Generate a migration, seeder, factory, and resource controller for the model.
  • -c, --controller - Create a new controller for the model.
  • -f, --factory - Create a new factory for the model.
  • --force - Create the class even if the model already exists.
  • -m, --migration - Create a new migration file for the model.
  • -s, --seed - Create a new seeder file for the model.
  • -p, --pivot - Indicates if the generated model should be a custom intermediate table model.
  • -r, --resource - Indicates if the generated controller should be a resource controller.
  • --api - Indicates if the generated controller should be an API controller.

Arguments:

  • name - The name of the class.

make:notification

php artisan make:notification MyNotification

Create a new notification class.

Options:

  • -f, --force - Create the class even if the notification already exists.
  • -m, --markdown[=MARKDOWN] - Create a new Markdown template for the notification.

Arguments:

  • name - The name of the class.

make:observer

php artisan make:observer MyObserver

Create a new observer class.

Options:

  • -m, --model[=MODEL] - The model that the observer applies to.

Arguments:

  • name - The name of the class.

make:policy

php artisan make:policy MyPolicy

Create a new policy class.

Options:

  • -m, --model[=MODEL] - The model that the policy applies to.
  • -g, --guard[=GUARD] - The guard that the policy relies on.

Arguments:

  • name - The name of the class.

make:provider

php artisan make:provider MyProvider

Create a new service provider class.

Arguments:

  • name - The name of the class.

make:request

php artisan make:request MyRequest

Create a new form request class.

Arguments:

  • name - The name of the class.

make:resource

php artisan make:resource MyResource

Create a new resource.

Options:

  • -c, --collection - Create a resource collection.

Arguments:

  • name - The name of the class.

make:rule

php artisan make:rule MyRule

Create a new validation rule.

Options:

  • -i, --implicit - Generate an implicit rule.

Arguments:

  • name - The name of the class.

make:seeder

php artisan make:seeder MySeeder

Create a new seeder class.

Arguments:

  • name - The name of the class.

make:test

php artisan make:test MyTest

Create a new test class.

Options:

  • -u, --unit - Create a unit test.

Arguments:

  • name - The name of the class.

migrate:fresh

php artisan migrate:fresh

Drop all tables and re-run all migrations.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --drop-views - Drop all tables and views.
  • --drop-types - Drop all tables and types (Postgres only).
  • --force - Force the operation to run when in production.
  • --path[=PATH] - The path(s) to the migrations files to be executed (multiple values allowed).
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.
  • --schema-path[=SCHEMA-PATH] - The path to a schema dump file.
  • --seed - Indicates if the seed task should be re-run.
  • --seeder[=SEEDER] - The class name of the root seeder.
  • --step - Force the migrations to be run so they can be rolled back individually.

migrate:install

php artisan migrate:install

Create the migration repository.

Options:

  • --database[=DATABASE] - The database connection to use.

migrate:refresh

php artisan migrate:refresh

Reset and re-run all migrations.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --force - Force the operation to run when in production.
  • --path[=PATH] - The path(s) to the migrations files to be executed (multiple values allowed).
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.
  • --seed - Indicates if the seed task should be re-run.
  • --seeder[=SEEDER] - The class name of the root seeder.
  • --step[=STEP] - The number of migrations to be reverted & re-run.

migrate:reset

php artisan migrate:reset

Rollback all database migrations.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --force - Force the operation to run when in production.
  • --path[=PATH] - The path(s) to the migrations files to be executed (multiple values allowed).
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.
  • --pretend - Dump the SQL queries that would be run.

migrate:rollback

php artisan migrate:rollback

Rollback the last database migration.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --force - Force the operation to run when in production.
  • --path[=PATH] - The path(s) to the migrations files to be executed (multiple values allowed).
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.
  • --pretend - Dump the SQL queries that would be run.
  • --step[=STEP] - The number of migrations to be reverted.

migrate:status

php artisan migrate:status

Show the status of each migration.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --path[=PATH] - The path(s) to the migrations files to use (multiple values allowed).
  • --realpath - Indicate any provided migration file paths are pre-resolved absolute paths.

model:prune

php artisan model:prune

Prune models that are no longer needed.

Options:

  • --model[=MODEL] - Class names of the models to be pruned (multiple values allowed).
  • --chunk[=CHUNK] - The number of models to retrieve per chunk of models to be deleted [default: "1000"].

notifications:table

php artisan notifications:table

Create a migration for the notifications table.


optimize:clear

php artisan optimize:clear

Remove the cached bootstrap files.


package:discover

php artisan package:discover

Rebuild the cached package manifest.


queue:batches-table

php artisan queue:batches-table

Create a migration for the batches database table.


queue:clear

php artisan queue:clear

Delete all of the jobs from the specified queue.

Options:

  • --queue[=QUEUE] - The name of the queue to clear.
  • --force - Force the operation to run when in production.

Arguments:

  • connection - The name of the queue connection to clear.

queue:failed

php artisan queue:failed

List all of the failed queue jobs.


queue:failed-table

php artisan queue:failed-table

Create a migration for the failed queue jobs database table.


queue:flush

php artisan queue:flush

Flush all of the failed queue jobs.


queue:forget

php artisan queue:forget <id>

Delete a failed queue job.

Arguments:

  • id - The ID of the failed job.

queue:listen

php artisan queue:listen <connection>

Listen to a given queue.

Options:

  • --name[=NAME] - The name of the worker [default: "default"].
  • --delay[=DELAY] - The number of seconds to delay failed jobs (Deprecated) [default: "0"].
  • --backoff[=BACKOFF] - The number of seconds to wait before retrying a job that encountered an uncaught exception [default: "0"].
  • --force - Force the worker to run even in maintenance mode.
  • --memory[=MEMORY] - The memory limit in megabytes [default: "128"].
  • --queue[=QUEUE] - The queue to listen on.
  • --sleep[=SLEEP] - Number of seconds to sleep when no job is available [default: "3"].
  • --timeout[=TIMEOUT] - The number of seconds a child process can run [default: "60"].
  • --tries[=TRIES] - Number of times to attempt a job before logging it failed [default: "1"].

Arguments:

  • connection - The name of connection.

queue:monitor

php artisan queue:monitor <queues>

Monitor the size of the specified queues.

Options:

  • --max[=MAX] - The maximum number of jobs that can be on the queue before an event is dispatched [default: "1000"].

Arguments:

  • queues - The names of the queues to monitor.

queue:prune-batches

php artisan queue:prune-batches

Prune stale entries from the batches database.

Options:

  • --hours[=HOURS] - The number of hours to retain batch data [default: "24"].
  • --unfinished[=UNFINISHED] - The number of hours to retain unfinished batch data.

queue:prune-failed

php artisan queue:prune-failed

Prune stale entries from the failed jobs table.

Options:

  • --hours[=HOURS] - The number of hours to retain failed jobs data [default: "24"].

queue:restart

php artisan queue:restart

Restart queue worker daemons after their current job.


queue:retry

php artisan queue:retry

Retry a failed queue job.

Options:

  • --queue[=QUEUE] - Retry all of the failed jobs for the specified queue.
  • --range[=RANGE] - Range of job IDs (numeric) to be retried (multiple values allowed).

Arguments:

  • id - The ID of the failed job or "all" to retry all jobs.

queue:retry-batch

php artisan queue:retry-batch <id>

Retry the failed jobs for a batch.

Arguments:

  • id - The ID of the batch whose failed jobs should be retried.

queue:table

php artisan queue:table

Create a migration for the queue jobs database table.


queue:work

php artisan queue:work

Start processing jobs on the queue as a daemon.

Options:

  • --name[=NAME] - The name of the worker [default: "default"].
  • --queue[=QUEUE] - The names of the queues to work.
  • --daemon - Run the worker in daemon mode (Deprecated).
  • --once - Only process the next job on the queue.
  • --stop-when-empty - Stop when the queue is empty.
  • --delay[=DELAY] - The number of seconds to delay failed jobs (Deprecated) [default: "0"].
  • --backoff[=BACKOFF] - The number of seconds to wait before retrying a job that encountered an uncaught exception [default: "0"].
  • --max-jobs[=MAX-JOBS] - The number of jobs to process before stopping [default: "0"].
  • --max-time[=MAX-TIME] - The maximum number of seconds the worker should run [default: "0"].
  • --force - Force the worker to run even in maintenance mode.
  • --memory[=MEMORY] - The memory limit in megabytes [default: "128"].
  • --sleep[=SLEEP] - Number of seconds to sleep when no job is available [default: "3"].
  • --rest[=REST] - Number of seconds to rest between jobs [default: "0"].
  • --timeout[=TIMEOUT] - The number of seconds a child process can run [default: "60"].
  • --tries[=TRIES] - Number of times to attempt a job before logging it failed [default: "1"].

Arguments:

  • connection - The name of the queue connection to work.

route:cache

php artisan route:cache

Create a route cache file for faster route registration.


route:clear

php artisan route:clear

Remove the route cache file.


route:list

php artisan route:list

List all registered routes.

Options:

  • --columns[=COLUMNS] - Columns to include in the route table (multiple values allowed).
  • -c, --compact - Only show method, URI and action columns.
  • --json - Output the route list as JSON.
  • --method[=METHOD] - Filter the routes by method.
  • --name[=NAME] - Filter the routes by name.
  • --path[=PATH] - Only show routes matching the given path pattern.
  • --except-path[=EXCEPT-PATH] - Do not display the routes matching the given path pattern.
  • -r, --reverse - Reverse the ordering of the routes.
  • --sort[=SORT] - The column (precedence, domain, method, uri, name, action, middleware) to sort by [default: "uri"]

sail:install

php artisan sail:install

Install Laravel Sail's default Docker Compose file.

Options:

  • --with[=WITH] - The services that should be included in the installation.
  • --devcontainer - Create a .devcontainer configuration directory.

sail:publish

php artisan sail:publish

Publish the Laravel Sail Docker files.


schedule:list

php artisan schedule:list

List the scheduled commands.

Options:

  • --timezone[=TIMEZONE] - The timezone that times should be displayed in.

schedule:run

php artisan schedule:run

Run the scheduled commands.


schedule:test

php artisan schedule:test

Run a scheduled command.


schedule:work

php artisan schedule:work

Start the schedule worker.


schema:dump

php artisan schema:dump

Dump the given database schema.

Options:

  • --database[=DATABASE] - The database connection to use.
  • --path[=PATH] - The path where the schema dump file should be stored.
  • --prune - Delete all existing migration files.

session:table

php artisan session:table

Create a migration for the session database table.


storage:link

php artisan storage:link

Create the symbolic links configured for the application.

Options:

  • --relative - Create the symbolic link using relative paths.
  • --force - Recreate existing symbolic links.

stub:publish

php artisan stub:publish

Publish all stubs that are available for customization.

Options:

  • --force - Overwrite any existing files.

vendor:publish

php artisan vendor:publish

Publish any publishable assets from vendor packages.

Options:

  • --force - Overwrite any existing files.
  • --all - Publish assets for all service providers without prompt.
  • --provider[=PROVIDER] - The service provider that has assets you want to publish.
  • --tag[=TAG] - One or many tags that have assets you want to publish (multiple values allowed).

view:cache

php artisan view:cache

Compile all of the application's Blade templates.


view:clear

php artisan view:clear

Clear all compiled view files.