Skip to content

Commit 0e83bd0

Browse files
committed
Add closed at inverse flag
1 parent cba251b commit 0e83bd0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ Post::where('id', 4)->unexpire();
561561

562562
### Setup a closable model
563563

564+
#### With boolean flag
565+
564566
```php
565567
<?php
566568

@@ -577,6 +579,24 @@ class Post extends Model
577579

578580
*Model must have boolean `is_closed` column in database table.*
579581

582+
#### With timestamp flag
583+
584+
```php
585+
<?php
586+
587+
namespace App\Models;
588+
589+
use Cog\Flag\Traits\Classic\HasClosedAt;
590+
use Illuminate\Database\Eloquent\Model;
591+
592+
class Post extends Model
593+
{
594+
use HasClosedAt;
595+
}
596+
```
597+
598+
*Model must have nullable timestamp `closed_at` column in database table.*
599+
580600
### Available functions
581601

582602
#### Get only not closed models

0 commit comments

Comments
 (0)