-
-
Notifications
You must be signed in to change notification settings - Fork 21
Verifiable model
Anton Komarev edited this page Mar 24, 2020
·
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()->get();
Post::withoutNotVerified()->get();
Post::onlyNotVerified()->get();
Post::whereKey(4)->verify();
Post::whereKey(4)->undoVerify();