Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ResetPromptQuotaForEveryOneAt12amEST | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| handle | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Console\Commands; |
| 4 | |
| 5 | use App\Http\Models\FlyMsgAI\PromptUsage; |
| 6 | use Illuminate\Console\Command; |
| 7 | use App\Http\Models\FlyMsgAI\SavedPrompt; |
| 8 | use Illuminate\Support\Facades\Log; |
| 9 | |
| 10 | class ResetPromptQuotaForEveryOneAt12amEST extends Command |
| 11 | { |
| 12 | /** |
| 13 | * The name and signature of the console command. |
| 14 | * |
| 15 | * @var string |
| 16 | */ |
| 17 | protected $signature = 'app:reset-prompt-quota-for-every-one-at12am-e-s-t'; |
| 18 | |
| 19 | /** |
| 20 | * The console command description. |
| 21 | * |
| 22 | * @var string |
| 23 | */ |
| 24 | protected $description = 'Command description'; |
| 25 | |
| 26 | /** |
| 27 | * Execute the console command. |
| 28 | */ |
| 29 | public function handle() |
| 30 | { |
| 31 | $prompt_usages = PromptUsage::all(); |
| 32 | $this->info('Resetting for ' . $prompt_usages->count() . ' AI users'); |
| 33 | foreach ($prompt_usages as $prompt_usage) { |
| 34 | $prompt_usage->used = 0; |
| 35 | $prompt_usage->save(); |
| 36 | } |
| 37 | $this->info("Done"); |
| 38 | } |
| 39 | } |