Files
scraps/app/Console/Commands/TestSpoonacularCommand.php
kevin-DL fadb1bc00a Create spoonacular integration
- Find recipes by ingredients
2024-06-22 11:13:14 +01:00

27 lines
672 B
PHP

<?php
namespace App\Console\Commands;
use App\Http\Integrations\Spoonacular\Requests\FindRecipesByIngredients;
use App\Http\Integrations\Spoonacular\SpoonacularConnector;
use Illuminate\Console\Command;
class TestSpoonacularCommand extends Command
{
protected $signature = 'test:spoonacular';
protected $description = 'Command description';
public function handle(): void
{
$connector = new SpoonacularConnector();
$request = new FindRecipesByIngredients(
ingredients: ['salmon', 'cheese', 'tomato'],
ranking: 2
);
$response = $connector->send($request);
dd($response->json());
}
}