Skip to content

Commit 6a985e7

Browse files
Rename trait
1 parent f611d4a commit 6a985e7

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
99
### Changed
1010

1111
- Add support for Laravel 5.8 (requires PHP 7.2 or higher)
12+
- Renamed `BooleanDates` trait to `HasBooleanDates`
1213

1314
### Removed
1415

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
[![Follow @sebastiaanluca on Twitter][twitter-profile-badge]][link-twitter]
1111
[![Share this package on Twitter][twitter-share-badge]][link-twitter-share]
1212

13-
Say you've got a registration page for users where they need to accept your terms and perhaps can opt-in to certain features using checkboxes. With the new(-ish) GDPR privacy laws, you're somewhat required to not just keep track of the fact *if* they accepted those (or not), but also *when* they did.
13+
**A package to automatically convert boolean fields to dates (and back to booleans) so you always know when something was accepted or changed.**
1414

15-
**This package automatically converts those boolean fields to dates so you always know when something was accepted or changed.**
15+
Say you've got a registration page for users where they need to accept your terms and perhaps can opt-in to certain features using checkboxes. With the new(-ish) GDPR privacy laws, you're somewhat required to not just keep track of the fact *if* they accepted those (or not), but also *when* they did.
1616

1717
### Example
1818

@@ -76,17 +76,17 @@ $user->accepted_terms_and_conditions_at;
7676
composer require sebastiaanluca/laravel-boolean-dates
7777
```
7878

79-
**Require the `BooleanDates` trait** in your Eloquent model, then add the `$booleanDates` and `$dates` (optional) fields:
79+
**Require the `HasBooleanDates` trait** in your Eloquent model, then add the `$booleanDates` and `$dates` (optional) fields:
8080

8181
```php
8282
<?php
8383

8484
use Illuminate\Database\Eloquent\Model;
85-
use SebastiaanLuca\BooleanDates\BooleanDates;
85+
use SebastiaanLuca\BooleanDates\HasBooleanDates;
8686

8787
class User extends Model
8888
{
89-
use BooleanDates;
89+
use HasBooleanDates;
9090

9191
/**
9292
* @var array

src/BooleanDates.php renamed to src/HasBooleanDates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Carbon\Carbon;
88

9-
trait BooleanDates
9+
trait HasBooleanDates
1010
{
1111
/**
1212
* Convert the model's attributes to an array.

tests/resources/TestModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
namespace SebastiaanLuca\BooleanDates\Tests\resources;
66

77
use Illuminate\Database\Eloquent\Model;
8-
use SebastiaanLuca\BooleanDates\BooleanDates;
8+
use SebastiaanLuca\BooleanDates\HasBooleanDates;
99

1010
class TestModel extends Model
1111
{
12-
use BooleanDates;
12+
use HasBooleanDates;
1313

1414
/**
1515
* Set the date of fields to the current date and time if a counterpart boolean field is

0 commit comments

Comments
 (0)