Skip to content

Commit

Permalink
Improve readme styling
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed May 20, 2017
1 parent 5699855 commit b3bd356
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Due to time constraints, we are not always able to respond as quickly as we woul
This project comes with a configuration file for php-cs-fixer (.php_cs) that you can use to (re)format your sourcecode for compliance with this project's coding guidelines:

```shell
vendor/bin/php-cs-fixer fix
$ vendor/bin/php-cs-fixer fix
```

## PHPUnit tests

The phpunit script can be used to invoke the PHPUnit test runner:

```shell
vendor/bin/phpunit
$ vendor/bin/phpunit
```

## Reporting issues
Expand Down
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@

## Introduction

Laravel wrapper for the [Optimus Library](https://github.com/jenssegers/optimus) by Jens Segers with multiple connections. Optimus is a small open-source library that generates short, unique, non-sequential ids from numbers. With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer hash. It is similar to Hashids, but will generate integers instead of random strings. It is also super fast.
Laravel wrapper for the [Optimus Library](https://github.com/jenssegers/optimus) by [Jens Segers](https://github.com/jenssegers) with multiple connections support. Optimus is a small open-source library that generates short, unique, non-sequential ids from numbers. With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer hash. It is similar to Hashids, but will generate integers instead of random strings. It is also super fast.

## Features

- Designed to work with Laravel Eloquent models.
- Configurable multiple connections support.
- Following PHP Standard Recommendations:
- [PSR-2 (Coding Style Guide)](http://www.php-fig.org/psr/psr-2/).
- [PSR-4 (Autoloading Standard)](http://www.php-fig.org/psr/psr-4/).
- Covered with unit tests.

## Installation

First, pull in the package through Composer.

```sh
composer require cybercog/laravel-optimus
$ composer require cybercog/laravel-optimus
```

And then include the service provider within `app/config/app.php`.
Expand All @@ -39,8 +48,8 @@ If you want you can use the [facade](http://laravel.com/docs/facades). Add the r

Laravel Optimus requires connection configuration. To get started, you'll need to publish config file:

```bash
php artisan vendor:publish --provider="Cog\Optimus\Providers\OptimusServiceProvider" --tag="config"
```sh
$ php artisan vendor:publish --provider="Cog\Optimus\Providers\OptimusServiceProvider" --tag="config"
```

This will create a `config/optimus.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
Expand All @@ -64,7 +73,7 @@ To get started you will need 3 keys in main connection;
Luckily for you, there is console command that can do all of this for you, just run the following command:

```sh
php vendor/bin/optimus spark
$ php vendor/bin/optimus spark
```

Copy-paste generated integers to your connection config.
Expand Down Expand Up @@ -152,7 +161,7 @@ app()->make('Foo')->bar(20);
Run the tests with:

```sh
vendor/bin/phpunit
$ vendor/bin/phpunit
```

## Contributing
Expand All @@ -165,8 +174,11 @@ If you discover any security related issues, please email [email protected]

## Credits

- [Anton Komarev](https://github.com/a-komarev)
- [All Contributors](../../contributors)
| | @mention |
|---|---|
| ![@a-komarev](https://avatars2.githubusercontent.com/u/1849174?s=64) | [@a-komarev](https://github.com/a-komarev) |

[Laravel Optimus contributors list](../../contributors)

Package was inspired by [Laravel Hashids](https://github.com/vinkla/laravel-hashids) package.

Expand All @@ -178,7 +190,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re

## Alternatives

*Not found.*
- [propaganistas/laravel-fakeid](https://github.com/Propaganistas/Laravel-FakeId)

*Feel free to add more alternatives as Pull Request.*

Expand All @@ -190,4 +202,4 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re

[CyberCog](http://www.cybercog.ru) is a Social Unity of enthusiasts. Research best solutions in product & software development is our passion.

![cybercog-logo](https://cloud.githubusercontent.com/assets/1849174/18418932/e9edb390-7860-11e6-8a43-aa3fad524664.png)
<a href="http://cybercog.ru"><img src="https://cloud.githubusercontent.com/assets/1849174/18418932/e9edb390-7860-11e6-8a43-aa3fad524664.png" alt="CyberCog"></a>
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"id",
"encrypt",
"decrypt",
"obfuscate"
"obfuscate",
"url",
"uri",
"public-id"
],
"authors": [
{
Expand Down Expand Up @@ -40,7 +43,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.11",
"graham-campbell/testbench": "^3.3",
"mockery/mockery": "^0.9.5",
"mockery/mockery": "^0.9.8",
"orchestra/testbench": "~3.4.0",
"phpunit/phpunit": "^5.7"
},
Expand All @@ -54,6 +57,9 @@
"Cog\\Optimus\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"config": {
"sort-packages": true
},
Expand Down

0 comments on commit b3bd356

Please sign in to comment.