-
-
Notifications
You must be signed in to change notification settings - Fork 21
Verifiable model
Anton Komarev edited this page Mar 19, 2019
·
3 revisions
<?php
namespace App\Models;
use Cog\Flag\Traits\Classic\HasVerifiedFlag;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasVerifiedFlag;
}
Model must have boolean is_verified
column in database table.
<?php
namespace App\Models;
use Cog\Flag\Traits\Classic\HasVerifiedAt;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasVerifiedAt;
}
Model must have nullable timestamp verified_at
column in database table.
Post::all();
Post::withNotVerified();
Post::withoutNotVerified();
Post::onlyNotVerified();
Post::whereKey(4)->verify();
Post::whereKey(4)->undoVerify();