Create spoonacular integration

- Find recipes by ingredients
This commit is contained in:
2024-06-22 11:13:14 +01:00
parent 50fc714895
commit fadb1bc00a
8 changed files with 312 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
<?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());
}
}