<?php

namespace App\Services;

use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;

class PatronicService
{
    public function getLastNews(): array
    {
        $news = [];
        $response = Http::acceptJson()->get('https://patronic.ir//wp-json/wp/v2/posts', [
            'per_page' => 3,
        ]);

        if ($response->successful()) {
            $news = $response->json();
        }

        return $news;
    }
}