Use laravel 5.3 or dingo built-in functions to create APIs?

I'm really new to API development, but I had a lot of sites before using Laravel. (and PHP)

Now I want to create my first API that can respond to any clients, such as Android, iOS, or an application with an Angular app.

In this case, I have done a lot of research that I can do the API through laravel.

I found that there is a package called dingo / api that simplifies and provides requirements for creating flexible APIs.

And on the other hand, the latest version of Laravel (5.3) added new features that help create APIs such as Passport .

But I am confused and do not know which one is best suited.

Is using Laravel enough in this case? Or will I definitely need Dingo?

+5
source share
1 answer

It really depends on what you want to achieve, if you want the api version to remain paginated and all functions, usually with the API, then for me the best approach is to use dingo api, but if you want to provide data in JSON from the already created website, just return the entities to the controller actions, and laravel itself will return them to json, this is a matter of your own choice, now you can always use the generator as follows: https://github.com/InfyOmLabs/laravel- generator , to generate all the forests, as well as to include REST API with the Documentation atsiey. And at the security level, you can use an OAuth server with a laravel passport or use JWT Auth using this package https://packagist.org/packages/tymon/jwt-auth , configuration and use is quite simple. I want to say that this is a matter of choice.

+5
source

Source: https://habr.com/ru/post/1258254/


All Articles