{"id":20119776,"url":"https://github.com/dlhck/lararest","last_synced_at":"2026-05-10T13:04:49.891Z","repository":{"id":56963391,"uuid":"85363032","full_name":"dlhck/LaraRest","owner":"dlhck","description":"The simplest way to generate CRUD API routes for Eloquent models in Laravel.","archived":false,"fork":false,"pushed_at":"2017-03-23T12:47:39.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-13T07:11:57.160Z","etag":null,"topics":["eloquent","laravel","laravel-5-package","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlhck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-17T23:32:39.000Z","updated_at":"2017-03-17T23:51:36.000Z","dependencies_parsed_at":"2022-08-21T08:20:50.216Z","dependency_job_id":null,"html_url":"https://github.com/dlhck/LaraRest","commit_stats":null,"previous_names":["dlhck/lararest"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlhck%2FLaraRest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlhck%2FLaraRest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlhck%2FLaraRest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlhck%2FLaraRest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlhck","download_url":"https://codeload.github.com/dlhck/LaraRest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241564557,"owners_count":19982960,"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":["eloquent","laravel","laravel-5-package","rest-api"],"created_at":"2024-11-13T19:17:07.121Z","updated_at":"2026-05-10T13:04:49.827Z","avatar_url":"https://github.com/dlhck.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaraRest\n[![Latest Stable Version](https://poser.pugx.org/davidhoeck/lararest/v/stable)](https://packagist.org/packages/davidhoeck/lararest)\n[![License](https://poser.pugx.org/davidhoeck/lararest/license)](https://packagist.org/packages/davidhoeck/lararest)\n[![Latest Unstable Version](https://poser.pugx.org/davidhoeck/lararest/v/unstable)](https://packagist.org/packages/davidhoeck/lararest)\n\nKeep your API routes file clean and generate your CRUD routes via LaraRest.\n\n## STEP 1\nInstall LaraRest via Composer.\n```\ncomposer require davidhoeck/lararest\n```\n\n## STEP 2 \nCreate your eloquent models.\n\n## STEP 3\nGo to your `api.php` in the `routes` folder.\n\n## STEP 4\nInitialize the `RestApiProvider`. Just paste the following lines of code,\nat the top of your `api.php` file.\n```\n/** @var \\DavidHoeck\\LaraRest\\RestApiProvider $apiProvider */\n$apiProvider = new \\DavidHoeck\\LaraRest\\RestApiProvider();\n```\n\n## STEP 5 \nHook your models into the provider. Add every model your want your CRUD REST routes to be generate.\n```\n$apiProvider-\u003eaddModel( new User() );\n```\n\n## EXAMPLE \nThe following line of code ...\n```\n$apiProvider-\u003eaddModel( new User() );\n```\n... produces these routes. \n\n| Method  | URI                    | Name              | Action                                      | Middleware |\n|---------|------------------------|-------------------|---------------------------------------------|------------|\n|GET | api/users               | api.users.index    | App\\Http\\Controllers\\UserController@index    | api        |\n|DELETE   | api/users               | api.users.create   | App\\Http\\Controllers\\UserController@create   | api        |\n|GET | api/users/paginate      | api.users.paginate | App\\Http\\Controllers\\UserController@paginate | api        |\n|GET | api/users/{id}          | api.users.find     | App\\Http\\Controllers\\UserController@find     | api        |\n|PUT      | api/users/{id}          | api.users.update   | App\\Http\\Controllers\\UserController@update   | api        |\n|DELETE   | api/users/{id}          | api.users.delete   | App\\Http\\Controllers\\UserController@delete   | api        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlhck%2Flararest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlhck%2Flararest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlhck%2Flararest/lists"}