How to Use Swagger in Laravel

If you need to interact with another developers team or your company wants to have documentation for your API, you can use OpenAPI Framework. Also, it is called Swagger. It is a standard system for API documentation in many companies. It is very important to have standardized up-to-date documentation because other developers will be able … Read more

How to Fix your App Key is Missing in Laravel

Laravel supports the encryption of fields in database tables and passwords. But you must set the encryption key in the APP_KEY environment variable. If the variable is empty or the key has an invalid format, you will get this error. In this short article, I will explain how to fix the “your app key is … Read more

How to Upload File in Laravel API Using Postman

In many cases, you may need the ability to upload one or multiple files to a Laravel application. If you use API, you can do it in various ways. Many APIs require files to be encoded as base64 string and sent as POST field. But it is not very convenient for testing and validation. You … Read more

How to Generate UUID in Laravel

UUID or Universally unique identifier can be used where you need to have some unique string, for example for HTML element identifiers, any tracking identifiers or as a primary key for Eloquent models. By default, Eloquent uses an integer as the primary key, but if this key is visible to visitors, it is better to … Read more

How to Check Laravel Version

Laravel developers are constantly adding new features to new versions of the framework. If you want to know whether your installation supports a specific feature, you should know your version of Laravel. This article will show several ways to check the Laravel version in the command line or your code. You can use the artisan … Read more

How to Install Specific Version of Package Using Composer

Composer is a package manager for PHP programming language. You can use it to install or update packages, manage their dependencies, and a lot of other things. By default, Composer installs the latest version of a required package. But you can install any specific version which you want. In this short article, I will show … Read more

How to Calculate Execution Time in PHP

There are a lot of cases when you might need to measure code execution time. For example, you want to speed up your application and you need to find the slowest part or you want to benchmark several approaches to do something. In this article, I will show you multiple ways to measure execution time … Read more

How to Rename Table in Laravel

Laravel has a migration mechanism for creating and changing database tables. If you want to create a new table, just create a migration and call the Schema::create() method. When you want to add or remove columns or indexes just call the Schema::table() method. But sometimes you may want to rename table. For example, you have … Read more

How to Set Timezone in Laravel

As you know, local time depends on the time zone. You can configure the time zone for your system or server, for the PHP instance. Laravel uses the UTC timezone by default. But if you want to use a specific time zone in the Laravel application, you should change the timezone in the Laravel settings. … Read more

Top 12 Useful Helpers For Laravel

Laravel framework tries to be more objective-oriented than other frameworks. It has a dependency injection feature that can help create and manage objects more efficiently. But it also has numerous global functions that make programming simpler. These functions are called helpers. In this article we will take a better look at the top 15 useful … Read more