Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/constlab/larapress
https://github.com/constlab/larapress
crud-api laravel laravel-package php74 rest-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/constlab/larapress
- Owner: constlab
- License: mit
- Created: 2020-01-10T14:52:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T11:44:46.000Z (over 4 years ago)
- Last Synced: 2024-10-13T13:06:58.798Z (2 months ago)
- Topics: crud-api, laravel, laravel-package, php74, rest-api
- Language: PHP
- Size: 289 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LaraPress
Пакет генерирующий REST API CRUD для модели
## Установка
1. `composer require constlab/larapress`
## Функционал
## Посты
**Модель**: `\LaraPress\Post\Post`
| URL | Method | Controller |
| ------------- | ------------- | ------------- |
| /api/posts | GET \| HEAD | `\LaraPress\Post\Controllers\PostIndexController` |
| /api/posts/{id-or-slug} | GET \| HEAD | `\LaraPress\Post\Controllers\PostViewController` |
| /api/posts | POST \| HEAD | `\LaraPress\Post\Controllers\PostCreateController` |
| /api/posts/{id} | PUT \| HEAD | `\LaraPress\Post\Controllers\PostUpdateController` |
| /api/posts/{id} | DELETE \| HEAD | `\LaraPress\Post\Controllers\PostDeleteController` |## Страницы
**Модель**: `\LaraPress\Page\Page`
| URL | Method | Controller |
| ------------- | ------------- | ------------- |
| /api/pages | GET \| HEAD | `\LaraPress\Post\Controllers\PostIndexController` |
| /api/pages/{id-or-slug} | GET \| HEAD | `\LaraPress\Post\Controllers\PostViewController` |
| /api/pages | POST \| HEAD | `\LaraPress\Post\Controllers\PostCreateController` |
| /api/pages/{id} | PUT \| HEAD | `\LaraPress\Post\Controllers\PostUpdateController` |
| /api/pages/{id} | DELETE \| HEAD | `\LaraPress\Post\Controllers\PostDeleteController` |## Создание нового типа записи
1. Создать модель наследующую класс `\LaraPress\Post\Post`
2. Добавить новый тип записи в конфиг `larapress.php` (где `wiki` название типа записи)```php
['wiki' => [
'model' => \App\Models\WikiPost::class,
],]
];
```