An open API service indexing awesome lists of open source software.

https://github.com/deniskorbakov/laravel-data-scribe

⚡️ A Scribe Plugin to generate API doc from spatie/laravel-data
https://github.com/deniskorbakov/laravel-data-scribe

laravel-data php plugins scribe

Last synced: 6 months ago
JSON representation

⚡️ A Scribe Plugin to generate API doc from spatie/laravel-data

Awesome Lists containing this project

README

          

# Laravel Data Scribe

GitHub Workflow Status
GitHub Workflow Status
Total Downloads
Latest Version
License

[This package](https://packagist.org/packages/deniskorbakov/laravel-data-scribe) is intended for [scribe](https://github.com/knuckleswtf/scribe) business with [laravel-data](https://github.com/spatie/laravel-data)

By default, [scribe](https://github.com/knuckleswtf/scribe) cannot generate documentation from [laravel-data](https://github.com/spatie/laravel-data), so I propose solutions in the form of this package with plugins

| Scribe Support | Description | Plugin Name | Status |
|:------------------------------|:---------------------------------------|:--------------------:|:------:|
| ``Body Parameters`` | Generate Body Params from laravel-data | LaravelDataBodyParam | ✅ |
| ``Attr Body Parameters`` | Generate Body Params Attribute | LaravelDataBodyParam | ✅ |
| ``Responses`` | Generate Response from laravel-data | 🚫 | ❌ |
| ``Custom Validation`` | Support Custom Rules in laravel-data | 🚫 | ❌ |

>Attribute Body Parameters - attribute has higher priority than body param from properties

## 📝 Getting Started

Install the package via composer:
```shell
composer require deniskorbakov/laravel-data-scribe
```

Add the plugin in your `config/scribe.php` file to the very end of the array:
```php
'strategies' => [
'bodyParameters' => [
...Defaults::BODY_PARAMETERS_STRATEGIES,
DenisKorbakov\LaravelDataScribe\LaravelDataBodyParam::class,
],
],
```

Run the command to generate documentation:
```bash
php artisan scribe:generate
```

## ⚒️ Local Development

Clone this repository:
```bash
git clone https://github.com/deniskorbakov/laravel-data-scribe
```

Let's go to the cloned repository:
```bash
cd laravel-data-scribe
```

To start, initialize the project and use it:
```bash
make init
```

## 🧪 Testing

You can run the command for testing after the step with local installation

Run Lint and Analyze code(phpstan/rector/phpcs):
```bash
make lint
```

Run Unit tests:
```bash
make test
```

Run mutation tests:
```bash
make test-mutation
```

Run test coverage:
```bash
make test-coverage
```

## 🤝 Feedback

We appreciate your support and look forward to making our product even better with your help!

[@Denis Korbakov](https://github.com/deniskorbakov)

---

📝 Generated from [deniskorbakov/skeleton-php-docker](https://github.com/deniskorbakov/skeleton-php-docker)