File: /var/www/html/laravel/app/Console/Commands/ProcessMel.php
<?php
namespace App\Console\Commands;
use App\Models\Mel;
use Illuminate\Console\Command;
class ProcessMel extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'mel:process';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Convert MEL texts to structured JSON';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
while ($mel = Mel::query()->where('response', 'like', '%{"status"%')->first()) {
$mel->process();
}
}
}