php artisan make:policy PostPolicy | Added in |
php artisan --help OR -h | Displays help for a given command |
php artisan --quiet OR -q | Do not output any message |
php artisan --version OR -V | Display this application version |
php artisan –no-interaction OR -n | Do not ask any interactive question |
php artisan --ansi | Force ANSI output |
php artisan --no-ansi | Disable ANSI output |
php artisan --env | The environment the command should run under |
php artisan --verbose | -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug |
php artisan clear-compiled | Remove the compiled class file |
php artisan env | Display the current framework environment |
php artisan help | Displays help for a command |
php artisan list | Lists commands |
php artisan tinker | Interact with your application |
php artisan down | Put the application into maintenance mode |
php artisan up | Bring the application out of maintenance mode |
php artisan optimize [--force] [--psr] | Optimize the framework for better performance--force Force the compiled class file to be --psr Do not optimize Composer dump-autoload. |
php artisan serve | Serve the application on the PHP development server |
php artisan serve --port 8080 | Change the default port |
php artisan serve --host 0.0.0.0 | Get it to work outside localhost |
php artisan app:name namespace | Set the application namespace |
php artisan auth:clear-resets | Flush expired password reset tokens |
php artisan cache:clear | Flush the application cache |
php artisan cache:table | Create a migration for the cache database table |
php artisan config:cache | Create a cache file for faster configuration loading |
php artisan config:clear | Remove the configuration cache file |
$exitCode = Artisan::call('config:cache'); | In program |
php artisan db:seed [--class[="..."]] [--database[="..."]] [--force] | Seed the database with records--class The class name of the root seeder (default: “DatabaseSeeder”)--database The database connection to seed--force Force the operation to run when in production. |
php artisan event:generate | Generate the missing events and handlers based on registration |
php artisan handler:command [--command="..."] name | Create a new command handler class--command The command class the handler handles. |
php artisan handler:event [--event="..."] [--queued] name | Create a new event handler class--event The event class the handler handles.--queued Indicates the event handler should be queued. |
php artisan key:generate | Set the application key |
php artisan make:command [--handler] [--queued] name | By default, this creates a self-handling command that isn’t pushed to the queue. Pass this the --handler flag to generate a handler, and the --queued flag to make it queued. |
make:console [--command[="..."]] name | Create a new Artisan command--command The terminal command should be assigned. (default: “command:name”) |
php artisan make:controller [--plain] name | Create a new resourceful controller--plain Generate an empty controller class. |
php artisan make:event name | Create a new event class |
php artisan make:middleware name | Create a new middleware class |
php artisan make:migration [--create[="..."]] [--table[="..."]] name | Create a new migration file--create The table to be created.--table The table to migrate. |
php artisan make:model name | Create a new Eloquent model class |
php artisan make:provider name | Create a new service provider class |
php artisan make:request name | Create a new form request class |
php artisan migrate [--database[="..."]] [--force] [--path[="..."]] [--pretend] [--seed] | Database migrations--database The database connection to use.--force Force the operation to run when in production.--path The path of migrations files to be executed.--pretend Dump the SQL queries that would be run.--seed Indicates if the seed task should be re-run. |
php artisan migrate:install [--database[="..."]] | Create the migration repository |
php artisan migrate:refresh [--database[="..."]] [--force] [--seed] [--seeder[="..."]] | Create a new migration file--seeder The class name of the root seeder. |
php artisan migrate:reset [--database[="..."]] [--force] [--pretend] | Rollback all database migrations--pretend Dump the SQL queries that would be run. |
php artisan migrate:rollback [--database[="..."]] [--force] [--pretend] | Rollback the last database migration |
php artisan migrate:status | Show a list of migrations up/down |
php artisan queue:table | Create a migration for the queue jobs database table |
php artisan queue:listen [--queue[="..."]] [--delay[="..."]] [--memory[="..."]] [--timeout[="..."]] [--sleep[="..."]] [--tries[="..."]] [connection] | Listen to a given queue--queue The queue to listen on--delay Amount of time to delay failed jobs (default: 0)--memory The memory limit in megabytes (default: 128)--timeout Seconds a job may run before timing out (default: 60)--sleep Seconds to wait before checking queue for jobs (default: 3)--tries Number of times to attempt a job before logging it failed (default: 0) |
php artisan queue:failed | List all of the failed queue jobs |
php artisan queue:failed-table | Create a migration for the failed queue jobs database table |
php artisan queue:flush | Flush all of the failed queue jobs |
php artisan queue:forget | Delete a failed queue job |
php artisan queue:restart | Restart queue worker daemons after their current job |
php artisan queue:retry id | Retry a failed queue job(id: The ID of the failed job) |
php artisan queue:subscribe [--type[="..."]] queue url | Subscribe a URL to an Iron.io push queuequeue : The name of Iron.io queue.url : The URL to be subscribed.--type The push type for the queue. |
php artisan queue:work [--queue[="..."]] [--daemon] [--delay[="..."]] [--force] [--memory[="..."]] [--sleep[="..."]] [--tries[="..."]] [connection] | Process the next job on a queue--queue The queue to listen on--daemon Run the worker in daemon mode--delay Amount of time to delay failed jobs (default: 0)--force Force the worker to run even in maintenance mode--memory The memory limit in megabytes (default: 128)--sleep Number of seconds to sleep when no job is available (default: 3)--tries Number of times to attempt a job before logging it failed (default: 0) |
php artisan route:cache | Create a route cache file for faster route registration |
php artisan route:clear | Remove the route cache file |
php artisan route:list | List all registered routes |
php artisan schedule:run | Run the scheduled commands |
php artisan session:table | Create a migration for the session database table |
php artisan vendor:publish [--force] [--provider[="..."]] [--tag[="..."]] php artisan tail [--path[="..."]] [--lines[="..."]] [connection] | Publish any publishable assets from vendor packages--force Overwrite any existing files.--provider The service provider that has assets you want to publish.--tag The tag that has assets you want to publish. |