How to Redirect with Message in Laravel

Redirecting to the previous page after doing an action is common practice in Laravel projects. However, If there is an error while performing the action, you need to inform the user about it. You can return the result in the API response if creating a SPA application. Although, if you have an application rendered using … Read more

How to Use ChartJS with Laravel

ChartJS is the most popular JavaScript library for creating charts, plots and diagrams. If you saw beautiful charts on any website, then there is a high possibility that they were built using this library. For example, the AdminLTE admin panel uses ChartJS for graphs. In this article, we will explain how to install and use … Read more

How to Create Login API in Laravel

Most Laravel projects require authorization. Some pages and API routes must be protected from unauthorized access and be available only for registered users. In the traditional approach, when PHP code renders a whole page, Laravel can use cookies for authorization. In modern SPA sites, Laravel provides only API. But APIs do not support cookies. In … Read more

How to Create REST API in Laravel

Modern websites are often developed in the SPA (Single Page Application) paradigm, when there is a separate backend written in PHP or another backend language and a frontend developed using one of the popular JavaScript frameworks, such as Vue or React. The backend implements only the API interface that the frontend uses to receive data … Read more

How to Use Script in Blade Laravel

If you place JavsScript code directly into the content section of the Blade template in Laravel with Vue 2, you will most likely see an error in the JavaScript console. The thing is that all JavaScript code should be in app.js and bootstrap.js. And blade files should contain only HTML code and rendering instructions. Sometimes, … Read more

How to Use SendGrid API in Laravel

SendGrid is the most popular service for sending email messages. If you want to send fewer emails, you can use it for free. SendGrid provides an SMTP API, so there is no problem using this service in Laravel. In this short article we will explain how to use the SendGrid API in Laravel. We will … Read more

How to Fix 429 Too Many Requests in Laravel

If you make too many requests to the Laravel API, you may see an error with the “429 Too Many Requests” message. By default, Laravel has a limit on the number of requests per minute for all API endpoints. This is done to protect the API from excessive load. However, sometimes it is still necessary … Read more

How to Request to External API in Laravel

You must often interact with different third-party APIs when developing various services. You can use file_get_contents or the curl extension for PHP to do this. Also, for many APIs, developers release libraries that you can use. But the use of low-level functions makes the code complex. On the other hand, you might have no access … Read more

How to Fix 404 Not Found in Laravel

You can usually see a 404 error when a web server can’t find the page you requested. For Laravel projects, a web server must redirect all requests for non-existent files to index.php. If you see the web server’s 404 error, it is probably misconfigured. However, Laravel has its own 404 page, and you can see … Read more

How to Fix Maximum Execution Time of 30 Seconds Exceeded in Laravel

If the exception with the message “Maximum execution time of 30 seconds exceeded” occurs in your application, probably your application is misdesigned. By default, PHP has an execution time limit of 30 seconds. So, all tasks that can take more than a few seconds should be handled in the background using Laravel queues. Although, you … Read more

Exit mobile version