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
In this tutorial we will create an Angular application that will authenticate to a Laravel OAuth server. We will use the authorization code with PKCE flow since the Angular application is an SPA or Single-page-application. In SPAs we can't store the client secret since it will be visible in the browser. So we are going to write the codes that will generate the correct login URL and redirect to it. After logging in to that URL the OAuth server will redirect back to our app where we can get an access token that we can use to request protected resources.
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 create an Angular application that authenticates to an OAuth2 server with Authorization Code flow. The app will redirect to the OAuth2 server's login page. After logging in, the user will be redirected back to the app and get access token and refresh token.
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.