Laravel is PHP based framework that helps in building large and small scale web applications. Its first release came out in 2011 and the current version is 9.
To display time with AM and PM we can use the format() method with characters that display time accordingly.
We can use carbon class to get the number of weekend days between two dates in the Laravel framework.
To get all environment variables from the .env file in Laravel we can use the PHP super global variable $_ENV. It returns all environmental variables in array format.
To update multiple records with the same data you need to use the whereIn() function along with the update() function in the Laravel framework.
To fetch today’s record you need to use the whereDate() function in your query along with the now() method from the carbon class.
In the Laravel framework, the collection class provides a has() method that checks if a key exists in the collection.
Laravel provides great features that help us to create API. Headers are the part of the API that carries information from the user end to the framework.
Importing excel file data into the Laravel framework is easy with the maatwebsite/excel package. In the previous article, we learned about exporting data in excel files.
Patrick Brouwers created a well-reputed package that imports and exports data in the Laravel framework. It has 49.4 million downloads at the time of writing this article which proves it
In the latest release of the Laravel framework (Laravel 9.30), Frank de Jonge added a scoped filesystem driver that helps to reuse the disk configurations.
A major change can be seen in Laravel version 9.19 which is Vite. The new build tool Vite is a replacement for the Laravel mix that compiles the bundles faster.
Carbon is a PHP-based package that deals with date and time. It has simplified how to get dates and times with the desired format.
Pint is a Laravel package that fixes coding styles to make the code more readable for developers. It is a package that is included in Laravel 9.x.x and it is built on top of the PHP-CS-Fixer package.
In the Laravel framework, directives simply run predefined PHP code in the way in blade files. In this article we have learned to create conditional and helper directives.
To access PHP variables into JavaScript in Laravel, you will need to pass data from the controller to view and then access through double curly braces.
Storing JSON formatted data into a database can save you from a lot of coding. But sometimes it adds difficulties to extend the feature. It can be good if you want to just save and show the data.
Migration allows to create, update, and delete tables through the PHP class-based code and command. Migration class has two methods which are up and down.
Backend developers often face issues in the queries which bring them for debugging. In Laravel, you can get the last executed query through the getQueryLog() method after enabling the query log.
Learn to deploy Laravel 9 applications on VPS (Virtual Private Server) Plesk. Deploying the Laravel application on the server looks challenging but in reality, it is easy.
In programming, we redirect class to class and also method to method based on data or conditions.