Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ResetPromptQuotaForEveryOneAt12amEST
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 handle
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace App\Console\Commands;
4
5use App\Http\Models\FlyMsgAI\PromptUsage;
6use Illuminate\Console\Command;
7use App\Http\Models\FlyMsgAI\SavedPrompt;
8use Illuminate\Support\Facades\Log;
9
10class 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}