Skip to content

atepam/laravel-alphavantage-client

Repository files navigation

Alpha Vantage API Client for Laravel

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');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages