LaravelPackages.net
Acme Inc.
Toggle sidebar
nishstha/monday-laravel

Laravel wrapper to interface with monday graphql api

435
0
v1.0.0
About nishstha/monday-laravel

nishstha/monday-laravel is a Laravel package for laravel wrapper to interface with monday graphql api. It currently has 0 GitHub stars and 435 downloads on Packagist (latest version v1.0.0). Install it with composer require nishstha/monday-laravel. Discover more Laravel packages by nishstha or browse all Laravel packages to compare alternatives.

Last updated

Monday Laravel

This package is used to query the monday.com's GraphQL api.

Usage

Please follow the steps below to install and use this package.

1. Require the package
composer require nishstha/monday-laravel
2. Publish the config file
php artisan vendor:publish --provider="Nishstha\Monday\MondayServiceProvider"
3. Setup your API Keys

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'),
];
4. All done

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;
Comments