Posts

Showing posts from March, 2024

Postman Collection Run - How to Test File Uploading API on CircleCi or Jenkins

Image
From last couple of days,  I was doing R&D on how we can test file uploading API on CircleCi or Postman collection Run? Finally, I found a way to test the File uploading APIs using the Postman Desktop app  OR Postman CLI collection run. I have also tested this solution, even on CircleCi for running the automated testing postman APIs by Postman CLI collection run. Here is step by step process, how you can test the file uploading API on CircleCi or Postman collection Run? Local Desktop App settings: Open and go to Local Postman app settings -> General Set working directly location  ( default is postman installation directory but can also choose any other directory ) Place files (to use in file upload APIs during the collection run) in the working directory selected as in the above step and also in the root directory of your project. Now go to the API in which you need to upload a file, and select the file from the working directory selected in step 2. Save that ...

How to Build Nested Tree Structures for Parent-Child using The Laravel Eloquent Relationships

A few days back, working on a Laravel project I had to create an API returning the deeply nested Tree structure for the parent-child relationship of a given object entity - in this case, a Company. Although as an experienced PHP developer, I know how to build Nested Tree Structures for Parent-Child relationships using core PHP and SQL queries. But I was looking to, if Laravel Eloquent provides any efficient inbuilt method to fetch the Parent-child relationship with a deep nested tree structure. This led me to search on ChatGPT for the same. Here I want to give credit to ChatGPT which not only saved my time but also suggested a new way to get the desired result using Laravel Eloquent Relationships. Before I explain the solution for building a Nested Tree Structure, first let's understand it. Understanding Nested Tree Structures: A nested tree structure organizes data in a hierarchical manner, making it easy to represent parent-child relationships. Each node in the tree can have mult...