How to Build Laravel 12 API From Scratch
These days, API is one of the most common tasks for Laravel back-end developers, so you would provid...
We found 26 results for "API".
These days, API is one of the most common tasks for Laravel back-end developers, so you would provid...
A short version of my Premium tutorial on Laravel Daily.
API-based projects are more and more popular, and they are pretty easy to create in Laravel. But one topic is less talked about - it's error handling for various exceptions. API consumers often complain that they get "Server error" but no valuable messages. So, how to handle API errors gracefully? How to return them in "readable" form?
Have you ever used an external API and specified its version? For example, have you noticed the "/v1/" in the URL of "https://api.openai.com/v1/models"? In this tutorial, I will explain how to use similar versioning for our own APIs we create with Laravel.
Many Laravel developer jobs require not only creating APIs but also interacting with other 3rd-party APIs. In this lengthy tutorial, we will show four examples of such APIs.
React.js is one of the most popular front-end frameworks, but it lacks examples of how to integrate it with Laravel API. So, in this long article, I will show you how to do it in details, step-by-step.
Laravel allows us to structure code in many ways, right? But with APIs, it's important to avoid some bad practices, cause it may break API clients and confuse other developers.
If you want to generate the API quickly from just Eloquent Model, there's a new tool for that. I've tried it out.
What if you want to create an API endpoint that would be public for the whole world? In this video, I will live-code exactly that, including some performance and security measures.
How to integrate with Google or OpenAI APIs in the "best practice" way, so it would be possible to test locally?
OpenApi or Swagger Specification for your Laravel project made easy
The first fully customizable Laravel JSON:API builder. "CRUD" and protect your resources with 0 (zero) extra line of code.
This package allows you to automatically generate a Postman collection based on your API routes. It also provides basic configuration and support for bearer auth tokens and basic auth for routes behind an auth middleware.
In this video, I will go through one Laravel API Controller and suggest some improvements. Would you add anything else?
I've given a task to my students to create two simple API endpoints in Laravel. Let's see how they did and what advice I can give to them.
Today I want to talk about Exceptions in Laravel, specifically with the example of API requests and the 404 Not Found case. How to override the non-ideal error message?
One potential security issue in your application may be comparing strings with loose comparison. Let me show the example.
I was wondering what should API Controller methods return. Let me show you what I found in this experiment.
This time I'm doing a "surprise" code review for a person from Twitter and giving 3 tips related to APIs and to the repository pattern.
When creating API applications, you often don't want to return ALL the data via API, especially sensitive fields like passwords. In this short tutorial, I will show 4 methods to return only the fields which you need.
If you launch an API request from a client like Postman, you may see an error in HTML and not JSON. How to prevent it?
If you're building a Laravel project with both Web and API sides, you need to customize error messages for each of them separately. In web-view there should be error pages, and API exceptions should return JSON with status codes. How to handle it? I will show you an example with case of Model Not Found 404.
If you use Route Model Binding in your API Controllers and the record is not found, it will automatically return the 404 status code with an error message like "No query results for model [App\\Models\\User] 1". How can you override it?
Resource controllers are great for CRUDs, but if we use them for APIs, there are two unnecessary methods - create() and edit(), cause there are no visual forms for it. So how to remove them from routes? There are two ways.
Laravel Orion allows you to build a fully featured REST API based on your Eloquent models and relationships with simplicity of Laravel as you love it.