Search code examples
laravelgitlabgitlab-api

How can I pull the list a user's project through Gitlab API by Laravel?


I'm very new at Gitlab API. I'm using it for my project. Well, I have one local Gitlab server with many projects (Or maybe it's call "repository") in there.

So, I want to use Laravel to pull some parameter that is list a user's projects by using Gitlab API. Honestly, I have no idea to start this work.

I already read the Gitlab documentation but still can't get it clearly. What I want is the image as below. Could you guys guide me to get this? Thank you very much.

This is what I want.


Solution

  • Here is the GitLab api to read the projects

    You can do file-get-contents to read something from api

    So, finally as per your gitlab configuration you can do like this to read all the projects

    $url = "http://yoururl/api/v4/projects";
    $homepage = file_get_contents($url);
    echo $homepage;
    

    Hope this helps you.