Learn how to use the ls command to obtain information about variables, constants, functions, classes, interfaces, traits, properties, and methods in PHP. Discover how to use the ls command without any options to list defined variables in the current scope. Understand that the ls command can be used to inspect object instances to learn about their properties and methods. Find out that using the ls command with non-object types will result in an error. Explore an example using the ls command on an Eloquent model instance to display class constants, properties, and methods. Discover that the ls command offers various options and filters to narrow down the output, such as viewing only properties of an Eloquent model.
Learn how to use the migrate command in Laravel to run migrations against the database. With options like --database to specify the database connection, --force to run migrations in a production environment, and --pretend to display SQL queries instead of running migrations, this command provides flexibility. Additionally, you can use flags like --seed to execute the db:seed command after running migrations and --step to increment the migration's batch number for rollback purposes.
Learn how to use the optimize command in Laravel to improve the performance of your application. This command offers two flags: --force to write the compiled class file, and --psr to disable the optimized class map loader. The compiled files cache is stored in bootstrap/cache/compiled.php. Find out how to implement these options in your development environment and increase the efficiency of your Laravel application.
The show command allows you to view the code behind functions, classes, objects, constants, methods, and properties in Laravel. It can be used to see the code for a specific function, like the can method in an Eloquent model, or for functions in the global namespace, like the dd helper function. You can even use it to see the entire class definition, such as when viewing the code behind a default Eloquent model like App\User.
Learn how to use the throw-up command in Tinker to re-throw exceptions out of a REPL session. This command can be used to throw the last occurred exception or a specific exception instance. Get started with this helpful feature today.
The trace command in Laravel allows you to show the current call stack. By default, it displays the last 10 lines of the call stack. However, you can customize the number of lines displayed using the -n option. For example, to show the last 20 lines, you can use the -n20 option. And if you want to view a specific range of the call stack, you can provide an option like -n5-20.
Learn how to take an application out of maintenance mode using the up command. This command removes the down file from the application's storage directory. Find out how to quickly execute the php artisan up command for the same purpose.
The whereami command in Laravel helps you pinpoint the exact location in your code base where you are currently executing code. Running whereami in a Tinker REPL session provides information about the file and line number where the code is being executed.
The wtf command in the mentioned Markdown content is used to display details about the most recent exception. It allows viewing the stack trace details, showing a few lines by default. By adding question marks or exclamation points as arguments, more lines of the stack trace can be displayed. Another option is to use the -v flag to display the entire back trace. An example session demonstrates how to use the wtf command to view the back trace of an exception.
Learn how to use the vendor:publish command in Laravel to publish assets from third-party vendor packages. This command allows you to choose which assets to publish using options like --force to overwrite existing files, --provider=<PROVIDER> to publish assets from a specific service provider, and --tag=* to limit the types of assets to be published. Examples are provided to demonstrate its usage, such as publishing assets from all registered providers or from a specific service provider, and using tags to publish specific types of assets.
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