We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cba251b commit 0e83bd0Copy full SHA for 0e83bd0
README.md
@@ -561,6 +561,8 @@ Post::where('id', 4)->unexpire();
561
562
### Setup a closable model
563
564
+#### With boolean flag
565
+
566
```php
567
<?php
568
@@ -577,6 +579,24 @@ class Post extends Model
577
579
578
580
*Model must have boolean `is_closed` column in database table.*
581
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
600
### Available functions
601
602
#### Get only not closed models
0 commit comments