Laravel Artisan

php artisan make:policy PostPolicyAdded 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 --ansiForce ANSI output
php artisan --no-ansiDisable ANSI output
php artisan --envThe 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-compiledRemove the compiled class file
php artisan envDisplay the current framework environment
php artisan helpDisplays help for a command
php artisan listLists commands
php artisan tinkerInteract with your application
php artisan downPut the application into maintenance mode
php artisan upBring 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 serveServe the application on the PHP development server
php artisan serve --port 8080Change the default port
php artisan serve --host 0.0.0.0Get it to work outside localhost
php artisan app:name namespaceSet the application namespace
php artisan auth:clear-resetsFlush expired password reset tokens
php artisan cache:clearFlush the application cache
php artisan cache:tableCreate a migration for the cache database table
php artisan config:cacheCreate a cache file for faster configuration loading
php artisan config:clearRemove 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:generateGenerate the missing events and handlers based on registration
php artisan handler:command [--command="..."] nameCreate a new command handler class
--command The command class the handler handles.
php artisan handler:event [--event="..."] [--queued] nameCreate a new event handler class
--event The event class the handler handles.
--queued Indicates the event handler should be queued.
php artisan key:generateSet the application key
php artisan make:command [--handler] [--queued] nameBy 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[="..."]] nameCreate a new Artisan command
--command The terminal command should be assigned. (default: “command:name”)
php artisan make:controller [--plain] nameCreate a new resourceful controller
--plain Generate an empty controller class.
php artisan make:event nameCreate a new event class
php artisan make:middleware nameCreate a new middleware class
php artisan make:migration [--create[="..."]] [--table[="..."]] nameCreate a new migration file
--create The table to be created.
--table The table to migrate.
php artisan make:model nameCreate a new Eloquent model class
php artisan make:provider nameCreate a new service provider class
php artisan make:request nameCreate 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:statusShow a list of migrations up/down
php artisan queue:tableCreate 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:failedList all of the failed queue jobs
php artisan queue:failed-tableCreate a migration for the failed queue jobs database table
php artisan queue:flushFlush all of the failed queue jobs
php artisan queue:forgetDelete a failed queue job
php artisan queue:restartRestart queue worker daemons after their current job
php artisan queue:retry idRetry a failed queue job(id: The ID of the failed job)
php artisan queue:subscribe [--type[="..."]] queue urlSubscribe a URL to an Iron.io push queue
queue: 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:cacheCreate a route cache file for faster route registration
php artisan route:clearRemove the route cache file
php artisan route:listList all registered routes
php artisan schedule:runRun the scheduled commands
php artisan session:tableCreate 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.

Leave a Reply

Your email address will not be published.