-
-
Notifications
You must be signed in to change notification settings - Fork 21
Verifiable model
Pe Ell edited this page Apr 17, 2017
·
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::withoutUnverified();
Post::onlyUnverified();
Post::withUnverified();
Post::where('id', 4)->verify();
Post::where('id', 4)->unverify();