Learn how to use the schedule:run command in Laravel to run tasks or commands. It is commonly used with a scheduler utility like Cron. You can run the command directly in your terminal to execute scheduled tasks. If there are no tasks ready to run, you will see a message indicating so. This command is helpful for troubleshooting any issues with the scheduler.
The session:table command generates a migration for the sessions database table, which is essential for using the database session driver. This command has no parameters and can be executed with php artisan session:table. Running this command multiple times will create multiple migrations, so it's important to change the table name in additional migration files to avoid errors during migration execution.
Learn how to use Laravel's tinker command to interact with your application and experiment or debug issues. tinker is a REPL (read-eval-print loop) environment that allows you to execute PHP code within the context of your Laravel application. You can enter code statements and immediately see the results, just like Chrome's Developer Tools. The Tinker REPL is powerful and allows you to interact with framework components, classes, and even execute code in the context of your application. You can create new instances of classes, set properties, call methods, retrieve data from the database, and more.
The buffer command in JavaScript is useful for viewing the contents of a multi-line expression without interrupting the input process. It allows you to easily check what you have typed so far. You can also use the --clear option to clear the current buffer if needed. Check out the example session provided to see how it works.
Learn how to clear the compiled classes and services application cache with the clear-compiled command. This command will remove the compiled.php and services.php files located in bootstrap/cache/ directory. It's equivalent to the php artisan clear:compiled command.
The doc command in Laravel allows you to view the documentation for various objects, classes, constants, methods, functions, and properties. It accepts the name or reference to the item as its argument. This command is particularly helpful due to Laravel's extensive code documentation. For example, you can easily access the documentation for the config helper function or the $table property on an Eloquent model using doc.
Learn how to put your application into maintenance mode using the down command. By creating a file named down in the framework storage path, you can ensure your application is temporarily unavailable. Discover how this command parallels the php artisan down command.
The dump command in Laravel's Tinker REPL is used to display information about a variable or class instance in the console window. It utilizes Symfony's VarDumper console component. The dd helper function is also available in Tinker, providing useful output in the context of a Laravel application.
Learn how to use the env command in Laravel to retrieve the name of the current framework environment. The environment name is specified in the .env file and can be accessed using the APP_ENV entry. This command is similar to php artisan env.
Learn how to use the history command in the Tinker REPL session to retrieve previously entered commands. With its options, you can easily search, replay, and even save commands to a file. Check out this example session and explore the various options available to streamline your workflow.
The past six months or so have been incredibly busy. What started as a new article series about cust...
Read moreIn this post I talk about how I resolved a mysterious illegal offset type error when viewing collect...
Read moreGenerating a custom Laravel routes file from a Statamic website to redirect to a new domain.
Read moreDisabling file hashes in Vite output can be accomplished by modifying your project's vite.config.js
Read moreLearn how to implement a custom component compiler for Laravel's Blade templating language in this p...
Read morePart 5 of 6 covers implementing a cache namespace and labeling system, which we can use to target mu...
Read more