PHPackages                             aaronjan/kobe - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. aaronjan/kobe

AbandonedArchivedLibrary[API Development](/categories/api)

aaronjan/kobe
=============

Kobe is a Swagger definition writing tool for PHP, it can be used with framework like Laravel or just native PHP.

v0.9.8(8y ago)164.6k4Apache-2.0PHP

Since May 11Pushed 8y ago3 watchersCompare

[ Source](https://github.com/AaronJan/Kobe)[ Packagist](https://packagist.org/packages/aaronjan/kobe)[ RSS](/packages/aaronjan-kobe/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

Kobe
====

[](#kobe)

`Kobe` is a [Swagger](http://swagger.io/) definition writing tool for `PHP`, it can be used with framework like [Laravel](https://laravel.com) or just native `PHP`.

Kobe can only generate [definitions part](http://swagger.io/specification/#definitionsObject) of the [Swagger Specification](http://swagger.io/specification/), so you must use this with a full-featured library like [zircote/swagger-php](https://github.com/zircote/swagger-php) (or just write those in PHP using array).

Why named "Kobe"? Well, I did a little research, according to the [internet](http://www.bleacherreport.com/articles/924693-10-nba-players-with-most-swagger), **Kobe Bryant** has the most swagger, so I think Kobe knows the difinition of `Swagger`.

Notice
------

[](#notice)

If you use `swagger-php` version `2.0.11` got schema not found error, see [here](https://github.com/AaronJan/Kobe/issues/3).

Introduction
------------

[](#introduction)

You must knew [zircote/swagger-php](https://github.com/zircote/swagger-php). If you used it before, you may complain these things like me:

1. How can I namespacing my definitions ?
2. Why writing nested stuff is so painful ?! Why I have to write so many definitions just for nesting ?!!
3. writing example value is killing me ..

Don't give up on `Swagger`, `Kobe` is here just for the `defintions`.

But first we have to know how `Swagger` works.

`Swagger` is a specification, it can be expressed in many ways, like `YAML` or `JSON`, commonly we use `JSON` in `PHP`. So whether you are using `zircote/swagger-php` or not, the final result is just a `JSON` string.

Therefore, **you can write other Swagger stuff using `zircote/swagger-php` (because it's good for all of that but `definitions`), and using [Kobe](https://github.com/aaronjan/kobe) to organize your `definitions`**,

Caution
-------

[](#caution)

**Kobe currently doesn't have any test, although I haven't found any bug, but be careful. I'll writing some tests when I have time, or you can help this !**

Installation
------------

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
$ composer require aaronjan/kobe
```

Example
-------

[](#example)

Let's demostrate `Kobe` with a simple `Laravel` project.

First we create a folder `app/Swagger/Definitions/` to store all our `Definitions`, and create a `BaseDefinition` in `app/Swagger/BaseDefinition.php` like below:

```
