mirror of
https://github.com/kevin-DL/scraps.git
synced 2026-01-12 02:05:14 +00:00
Create spoonacular integration
- Find recipes by ingredients
This commit is contained in:
26
app/Console/Commands/TestSpoonacularCommand.php
Normal file
26
app/Console/Commands/TestSpoonacularCommand.php
Normal 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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user