{"id":14975020,"url":"https://github.com/tony133/laravel-api-rest","last_synced_at":"2025-04-07T12:06:46.162Z","repository":{"id":37014729,"uuid":"74612085","full_name":"Tony133/laravel-api-rest","owner":"Tony133","description":"Simple example of a API REST with Laravel 9.x","archived":false,"fork":false,"pushed_at":"2023-04-19T21:00:53.000Z","size":415,"stargazers_count":220,"open_issues_count":0,"forks_count":93,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-10-11T11:23:24.666Z","etag":null,"topics":["api","api-rest","laravel","laravel-application","laravel9","php","rest","rest-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tony133.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-23T20:35:40.000Z","updated_at":"2024-09-20T06:17:26.000Z","dependencies_parsed_at":"2024-09-18T23:30:44.959Z","dependency_job_id":null,"html_url":"https://github.com/Tony133/laravel-api-rest","commit_stats":{"total_commits":76,"total_committers":6,"mean_commits":"12.666666666666666","dds":"0.22368421052631582","last_synced_commit":"9b50c4a190700abec30a97d71658021fc6bd854b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony133%2Flaravel-api-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony133%2Flaravel-api-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony133%2Flaravel-api-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony133%2Flaravel-api-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tony133","download_url":"https://codeload.github.com/Tony133/laravel-api-rest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219861467,"owners_count":16555994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-rest","laravel","laravel-application","laravel9","php","rest","rest-api"],"created_at":"2024-09-24T13:51:24.370Z","updated_at":"2024-10-11T11:23:54.540Z","avatar_url":"https://github.com/Tony133.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Api Rest\n\n[![Build Status](https://travis-ci.org/Tony133/laravel-api-rest.svg?branch=master)](https://travis-ci.org/Tony133/laravel-api-rest)\n\nSimple example of a REST API with Laravel 9.x\n\n## Install with Composer\n\n```\n    $ curl -s http://getcomposer.org/installer | php\n    $ php composer.phar install or composer install\n```\n\n## Set Environment\n\n```\n    $ cp .env.example .env\n```\n\n## Set the application key\n\n```\n   $ php artisan key:generate\n```\n\n## Run migrations and seeds\n\n```\n   $ php artisan migrate --seed\n```\n\n## Getting with Curl\n\n```\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://127.0.0.1:8000/api/books\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://127.0.0.1:8000/api/books/:id\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X POST -d '{\"title\":\"Foo bar\",\"price\":\"19.99\",\"author\":\"Foo author\",\"editor\":\"Foo editor\"}' http://127.0.0.1:8000/api/books\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X PUT -d '{\"title\":\"Foo bar\",\"price\":\"19.99\",\"author\":\"Foo author\",\"editor\":\"Foo editor\"}' http://127.0.0.1:8000/api/books/:id\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X DELETE http://127.0.0.1:8000/api/books/:id\n```\n\n## Pagination with Curl\n\n```\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://127.0.0.1:8000/api/books?page=:number_page  -H 'Authorization:Basic username:password or email:password'\n```\n\n## User Authentication with Curl with middleware auth.basic.username\n\n```\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://127.0.0.1:8000/api/books  -H 'Authorization:Basic username:password'\n```\n\n## User Authentication with Curl using middleware auth.basic\n\n```\n    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://127.0.0.1:8000/api/books  -H 'Authorization:Basic email:password'\n```\n\n## Run App in container Docker with Laravel Sail \n\n```\ndocker run --rm \\\n    -u \"$(id -u):$(id -g)\" \\\n    -v $(pwd):/opt \\\n    -w /opt \\\n    laravelsail/php81-composer:latest \\\n    composer install --ignore-platform-reqs\n```\n\n## Run Start Application with Laravel Sail\n```\n  ./vendor/bin/sail up\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony133%2Flaravel-api-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony133%2Flaravel-api-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony133%2Flaravel-api-rest/lists"}