Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Spotify Web Api Php Laravel Package

jwilsson/spotify-web-api-php

View on GitHub
Deep Wiki
Context7

Setting custom cURL options

Sometimes, you need to override the default cURL options. For example increasing the timeout or setting some proxy setting.

In order to set custom cURL options, you'll need to instantiate a Request object yourself and passing it to SpotifyWebAPI instead of letting it set it up itself.

For example:

$options = [
    'curl_options' => [
        CURLOPT_TIMEOUT => 60,
    ],
];

$request = new SpotifyWebAPI\Request($options);

// You can also call setOptions on an existing Request instance
$request->setOptions($options);

// Then, pass the $request when instantiating Session and SpotifyWebAPI
$session = new SpotifyWebAPI\Session(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI',
    $request
);

$api = new SpotifyWebAPI\SpotifyWebAPI([], null, $request);

// And continue as usual

The options you pass in curl_options will be merged with the default ones and existing options with the same key will be overwritten by the ones passed by you.

Refer to the PHP docs for a complete list of cURL options.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views