Laravel Web and API: Same or Separate Controllers?
Sometimes you may encounter the situation that you need to return the same data on the web and via API. Should it be in the same or separate controllers? There are a few ways to handle it.
In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.
Sometimes you may encounter the situation that you need to return the same data on the web and via API. Should it be in the same or separate controllers? There are a few ways to handle it.
One of the most common questions about automated testing in Laravel is how to write tests for the usage of some external API. There are three ways to do that, and I will show all of those in this article.
When working with APIs, you often need to return an Eloquent response in JSON format. By default, Laravel transforms the response into JSON if you just return a Model or Eloquent Collection.
One of the most common questions I see about Laravel is how to structure the project. Or, in other words, where to put the logic out of the Controllers? In this article, I will try to show the options, trying to shorten one Controller method as an example.
If you want to search in multiple Eloquent models - like posts, videos, and courses - there are a lot of different ways, with or without external packages and tools. Let's explore them in this article.
If you are a junior Laravel developer and want to practice your skills, you can create a demo project, put it on GitHub, and that example could help you when interviewing for a future job. But what projects you could build, exactly? Here's the list of ideas for you.
Filament is an awesome rapidly growing adminpanel platform that includes table builder, form builder, and more features. But also there are many plugins that add even more functionality. Let's explore some of the best ones, in this article.
If you want to replace DB auto-increment IDs with something more sophisticated, one of the solutions is UUID. In this article, I will show you how UUID columns work in Laravel, and what are the options and tools to use them.
I've recently read a Laracasts forum post with a question about validating a date period. Decided to write this article with a possible solution.
Database Transactions are essential if you want to perform a few DB insert/update/delete operations and ensure the integrity of the data. Let's take a look at 5 different examples from Laravel open-source projects.