You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Require the `BooleanDates` trait in your Eloquent model, then add the `$booleanDates` and `$dates` (optional) fields:
81
+
**Require the `BooleanDates` trait** in your Eloquent model, then add the `$booleanDates` and `$dates` (optional) fields:
82
82
83
83
```php
84
+
<?php
85
+
84
86
use Illuminate\Database\Eloquent\Model;
85
87
use SebastiaanLuca\BooleanDates\BooleanDates;
86
88
@@ -110,7 +112,36 @@ class User extends Model
110
112
}
111
113
```
112
114
113
-
Adding the boolean dates _values_ to the `$dates` array is **optional**, but encouraged as it'll convert all your boolean datetimes to Carbon instances.
115
+
Adding the boolean date fields to the `$dates` array is **optional**, but encouraged as it'll convert all your boolean datetimes to Carbon instances.
116
+
117
+
To wrap up, create a **migration** to create a new or alter your existing table and add the timestamp fields:
118
+
119
+
```php
120
+
<?php
121
+
122
+
use Illuminate\Database\Migrations\Migration;
123
+
use Illuminate\Database\Schema\Blueprint;
124
+
use Illuminate\Support\Facades\Schema;
125
+
126
+
class AddAgreementFields extends Migration
127
+
{
128
+
/**
129
+
* Run the migrations.
130
+
*
131
+
* @return void
132
+
*/
133
+
public function up() : void
134
+
{
135
+
Schema::table('users', function (Blueprint $table) {
0 commit comments