This package is used to query the monday.com's GraphQL api.
Please follow the steps below to install and use this package.
composer require nishstha/monday-laravel
php artisan vendor:publish --provider="Nishstha\Monday\MondayServiceProvider"
You will need to setup your monday api keys in config/monday.php
.
return [
'api_url' => env('MONDAY_API_URL', 'https://api.monday.com/v2'),
'api_key' => env('MONDAY_API_KEY', 'your_key_here'),
];
Now that we are done with that. We can call the Monday API. See the example below.
Make sure to import the facade at the top
use Nishstha\Monday\Facades\Monday;
then we can call the api using
$response = Monday::call($query);
The response returned is a of type \GuzzleHttp\Psr7\Response
object or null
.
The query can be easily structed :
$query = <<<GQL
query{
boards(ids: $boardId){
groups{
id,
title
}
}
}
GQL;
// passing true as the second parameter returns the data object
$response = Monday::call($query,true);
$data = $response->boards->groups;