atepam/laravel-alphavantage-client

AlphaVantage Client for Laravel

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/atepam/laravel-alphavantage-client

0.1.5 2024-07-19 14:12 UTC

This package is auto-updated.

Last update: 2025-12-19 17:16:49 UTC


README

Installation

composer require atepam/laravel-alphavantage-client

Configuration

php artisan vendor:publish --provider="Atepam\AlphavantageClient\Providers\LatestPriceClientProvider" --tag="config"

Services

Latest Price

https://www.alphavantage.co/documentation/#latestprice

Usage

Via facade

    $data = AVLatestPrice::getLatestPrice('IBM');

Or via DI container

<?php

namespace App;

use Atepam\AlphavantageClient\Services\LatestPrice;

class ThisIsTheClass
{
    public function __construct(
        public readonly LatestPrice $avLatestPrice,
    )
    {
      //
    }

    public function getLatestPrice(string $symbol): array
    {
        return $this->avLatestPrice->getLatestPrice($symbol);
    }
}

Or instantiate

use Atepam\AlphavantageClient\Services\LatestPrice;

$client = app(LatestPrice::class);
$data = $client->getLatestPrice('IBM');