Weave 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.
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode