Hey Laravel Developers
Starting with Laravel v11.35.0, we have a new class available called Uri.
This class as the name suggests allows us to parse and manipulate URIs and their components easily.
Now you no longer need to work with the parse_url(), http_build_query() and other core PHP functions.
This new Uri class is a more developer-friendly API for working with URIs as shown in the below example.
Hey Laravel Developers
Task scheduling is one of the most important features in Laravel.
It allows you to schedule commands easily within your application.
Among Scheduler's options, two interesting methods are pingOnSuccess() and pingOnFailure().
As their names suggest, these methods ping the provided URL based on the command output result, i.e., whether the command was executed successfully or not.
An example use case is when you want to ping an external service based on when the command executes successfully.
Hey Laravel Developers
Task scheduling is one of the most important features in Laravel.
It allows you to schedule commands easily within your application.
Among the options the Scheduler provides, two interesting methods are pingBefore() and thenPing().
As their names suggest, these methods ping the provided URL before and after the execution of a command.
This can be useful in cases where you want to notify a third-party service before and after the completion of the command.
Hey Laravel Developers
If you have ever worked with enums in PHP, you should know about the cases() method that comes with enums.
The cases() method basically returns all the different cases available inside the Enum, which you can iterate over using a loop.
For example, in the code snippet below, we are using the cases() method to return all the possible roles in the application, which is then used to render a select input on the front end.
Hey Laravel Developers
Starting with Laravel v11.34.0, we have a new assertCount() method available on the fake Storage class.
This method as the name suggests allows us to verify the count of the files uploaded on the specified path.
As handling and storing files is such a common task in any web application, having such assertion methods is good to have.
What do you think about it !!