From 0fb9d7c27b9946214275378492d7dfe8413ce125 Mon Sep 17 00:00:00 2001 From: Attila Fulop Date: Mon, 16 Oct 2017 11:04:08 +0300 Subject: [PATCH] Doc improved according to enum v2.1.0; badge love; v1.1-dev started --- Changelog.md | 2 +- README.md | 16 ++++++++-------- composer.json | 5 +++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index 792e4a7..5a0135e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,4 +7,4 @@ ###### 2017-10-06 - Initial release for Enum 2.0+, Eloquent 5.0 - 5.5 -- Works likes Eloquent's `$cast` property on models, but internally hooks into the mutator/accessor mechanism +- Works like Eloquent's `$cast` property on models, but internally hooks into the mutator/accessor mechanism diff --git a/README.md b/README.md index 59a70b0..1e30d79 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Konekt Enum Eloquent Bindings -[![Build Status](https://travis-ci.org/artkonekt/enum-eloquent.png?branch=master)](https://travis-ci.org/artkonekt/enum-eloquent) -[![Latest Stable Version](https://poser.pugx.org/konekt/enum-eloquent/version.png)](https://packagist.org/packages/konekt/enum-eloquent) -[![Total Downloads](https://poser.pugx.org/konekt/enum-eloquent/downloads.png)](https://packagist.org/packages/konekt/enum-eloquent) -[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/) +[![Travis Build Status](https://img.shields.io/travis/artkonekt/enum-eloquent.svg?style=flat-square)](https://travis-ci.org/artkonekt/enum-eloquent) +[![Packagist Stable Version](https://img.shields.io/packagist/v/konekt/enum-eloquent.svg?style=flat-square&label=stable)](https://packagist.org/packages/konekt/enum-eloquent) +[![Packagist downloads](https://img.shields.io/packagist/dt/konekt/enum-eloquent.svg?style=flat-square)](https://packagist.org/packages/konekt/enum-eloquent) +[![MIT Software License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.md) This package provides support for auto casting [konekt enum](https://github.com/artkonekt/enum) fields in [Eloquent models](https://laravel.com/docs/5.4/eloquent-mutators). @@ -72,10 +72,10 @@ echo get_class($order->status); echo $order->status->value(); // output: 'pending' -echo $order->status->equals(OrderStatus::PENDING()) ? 'yes' : 'no'; +echo $order->status->isPending() ? 'yes' : 'no'; // output: yes -echo $order->status->equals(OrderStatus::CANCELLED()) ? 'yes' : 'no'; +echo $order->status->isCancelled() ? 'yes' : 'no'; // output: no // You can assign an enum object as attribute value: @@ -93,7 +93,7 @@ echo $order->status->value(); // It still accepts scalar values: $order->status = 'completed'; -echo $order->status->equals(OrderStatus::COMPLETED()) ? 'yes' : 'no'; +echo $order->status->isCompleted() ? 'yes' : 'no'; // output: yes // But it doesn't accept scalar values that aren't in the enum: @@ -104,4 +104,4 @@ $order->status = 'negotiating'; Enjoy! -For detailed usage of konekt enums refer to [its readme](https://github.com/artkonekt/enum). +For detailed usage of konekt enums refer to the [Konekt Enum Documentation](https://artkonekt.github.io/enum). diff --git a/composer.json b/composer.json index 2c05813..5601af1 100644 --- a/composer.json +++ b/composer.json @@ -29,5 +29,10 @@ "psr-4": { "Konekt\\Enum\\Eloquent\\Tests\\": "tests/" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } } }