Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

macem3664's avatar

Why there is not much example or tutorial about Api?

I'm working with two different project which are connected with Api. Since I'm new to Api I've been struggling a lot since all search results are how you create Api call and send data and protecting them and so on, but I couldn't find anything on how I should receive and view them and work with them with security. Please suggest me some tutorials or documentation so that I can learn more.

Between my two project 1st one holds product detail which are sent to 2nd project via Api, I've able to receive them but not with security. and Second one receives data and enable users to create invoice and stores in own database, also sends to 1st project via api. Thank you.

0 likes
9 replies
vincent15000's avatar

To use an API securely, you need to use tokens. For example with Laravel you can use Sanctum which offers you a secure environment to use APIs.

https://laravel.com/docs/10.x/sanctum

Furthermore securing an API isn't sufficient, you also have to be aware that all datas sent to the frontend are accessible, even if they are not displayed on the screen. So you need to send the strict minimum datas you want to display. To achieve this you can use Laravel API resources.

https://laravel.com/docs/10.x/eloquent-resources

1 like
macem3664's avatar

@vincent15000 Sir, I searching for tutorial or documentation that will help me learn how to fetch those data from secured api with authentication in 2nd project. all the documentations shows how to send data securely but how to receive them, there is no video tutorial or documentation for them

1 like
vincent15000's avatar
Level 63

@macem3664 If you are using Livewire, you don't need to develop any API.

APIs are only useful to share datas with a frontend separated from the backend, for example if you develop a backend and you need to access the data from a mobile application.

1 like

Please or to participate in this conversation.