Clean Architecture, like Onion Architecture is one of the popular domain centric architecture. This is my first time trying it on Laravel but in this tutorial, we will create a boilerplate Clean Architecture for Laravel 8 with examples on how to use it.
In your Laravel project, imagine you have objects that mostly have the same methods or features and you want to dynamically create those objects, Factory Design Pattern helps you with that. Laravel uses this pattern when calling methods such as `app('cache')->store('redis')` in driver-based components.
Introduction In this tutorial we will create an API route where we can upload a file with title. We will create service classes to reduce the codes in the controller and view-models to reduce the arguments. View-models are optional but is helpful with passing data around from controllers to other classes which I already covered
… Read more
Introduction In the last tutorials we added OAuth authentication in our Laravel API and had the Angular App login to it. Now we can create a resource URL where we can get the posts with photos and videos. We will format the response with the help of Dingo API’s helper trait and PHP Leagues Fractal
… Read more
This tutorial will be the first part of multiple posts where we create an Angular SPA (Single Page Application) that uses a Laravel API. For this post we will work on setting up the project then adding authentication and authorization. We will be using Laravel's Passport together with Dingo API.
Dingo API currently only supports JWT and Basic authentication. In this tutorial we will create an authentication provider so Passport can work with Dingo API to support OAuth.
In this tutorial we will implement the repository pattern in Laravel. Repository contains the logic on how data is persisted and how to query the data. It will be most useful to avoid duplicate codes that execute the same queries and hide the complication from the code that wants the data.
In this tutorial we will use Swagger UI to create documentation for our Lumen or Laravel API. We will create a command that generates the swagger JSON file and a page to render the documentation. Then we will write basic phpdoc blocks and annotations.
In this tutorial, we will install PHP League's Fractal and write helper methods to transform models into arrays which can be turned into JSON. Fractal also formats the array using JSON API standard https://jsonapi.org. It can also load related objects in one request. In this project, we will use Lumen as our code base.
In this tutorial we will install Laravel Passport to a Lumen project. Laravel Passport does not work out of the box with Lumen. If you don't want to do these steps just to make it work then maybe you should consider using a composer package.