Skip to content

Commit

Permalink
feat: support laravel-enum v2 (#12)
Browse files Browse the repository at this point in the history
* feat: support laravel-enum v2

* fix: code review feedback
  • Loading branch information
atymic authored Jul 8, 2020
1 parent a4c8eb2 commit 08c15d2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
31 changes: 18 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@

All notable changes to `nova-enum-field` will be documented in this file.

## 1.0.0 - 2019-09-07
## 2.0.0 - 2020-07-08

- Initial release.
- Update `larave-enum` to `2.x`
- Drop support for laravel < `7.x`

## 1.0.1 - 2019-09-07
## 1.1.0 - 2019-09-30

- Push to packagist.
- Update from package template.
- Refactor and remove unnecessary code.
- Add tests.

## 1.0.2 - 2019-09-07
## 1.0.4 - 2019-09-27

- Fix version number.
- Add documentation.
- Refactor field code.

## 1.0.3 - 2019-09-27

- Cleanup codebase.
- Fix casting.

## 1.0.4 - 2019-09-27
## 1.0.2 - 2019-09-07

- Add documentation.
- Refactor field code.
- Fix version number.

## 1.1.0 - 2019-09-30
## 1.0.1 - 2019-09-07

- Update from package template.
- Refactor and remove unnecessary code.
- Add tests.
- Push to packagist.

## 1.0.0 - 2019-09-07

- Initial release.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ composer require simplesquid/nova-enum-field
This package requires that you use Attribute Casting in your models. From the docs at [BenSampo/laravel-enum](https://github.com/BenSampo/laravel-enum#attribute-casting), this can be done like so:

```php
use BenSampo\Enum\Traits\CastsEnums;
use BenSampo\Enum\Tests\Enums\UserType;
use Illuminate\Database\Eloquent\Model;

class Example extends Model
{
use CastsEnums;

protected $enumCasts = [
// 'attribute_name' => Enum::class
'user_type' => UserType::class,
];

protected $casts = [
'user_type' => 'int',
'user_type' => UserType::class,
];
}
```
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
],
"require": {
"php": "^7.3",
"laravel/nova": "^2.0|^3.0",
"illuminate/support": "^5.8|^6.0|^7.0",
"bensampo/laravel-enum": "^1.33"
"laravel/nova": "^3.0",
"illuminate/support": "^7.0",
"bensampo/laravel-enum": "^2.0"
},
"require-dev": {
"symfony/var-dumper": "^4.3",
"orchestra/testbench": "^3.8|^4.0|^5.0",
"symfony/var-dumper": "^5.0",
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.2|^9.0"
},
"autoload": {
Expand Down

0 comments on commit 08c15d2

Please sign in to comment.