- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 20
 
Activatable model
        Anton Komarev edited this page Mar 19, 2019 
        ·
        5 revisions
      
    <?php
namespace App\Models;
use Cog\Flag\Traits\Classic\HasActiveFlag;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
    use HasActiveFlag;
}Model must have boolean is_active column in database table.
Post::all();
Post::withNotActivated();Post::withoutNotActivated();Post::onlyNotActivated();Post::whereKey(4)->activate();Post::whereKey(4)->undoActivate();