Using the something_at
convention instead of just a boolean in Laravel models gives you visibility into when a flag was changed – like when a product went live.
1// Migration 2Schema::table('products', function (Blueprint $table) { 3 $table->datetime('live_at')->nullable(); 4}); 5 6// In your model 7public function live() 8{ 9 return !is_null($this->live_at);10}11 12// Also in your model13protected $dates = [14 'live_at'15];
Tip given by @alexjgarrett