PHP code example of fuitad / gazelle-laravel-wrapper
1. Go to this page and download the library: Download fuitad/gazelle-laravel-wrapper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fuitad / gazelle-laravel-wrapper example snippets
use GazelleLaravelWrapper\Facades\Gazelle;
// Authenticate
Gazelle::logIn('[email protected]', 'password');
// List all open projects
$projects = Gazelle::project->allOpenProjects();
// Get all shots for a project
$shots = Gazelle::shot->allShotsForProject($projects[0]);
// Log out
Gazelle::logOut();
use Gazelle\Gazelle;
class ProductionController extends Controller
{
public function __construct(private readonly Gazelle $gazelle) {}
public function index(): array
{
return $this->gazelle->project->allOpenProjects();
}
}
Gazelle::setToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...');
// Or with a refresh token
Gazelle::setToken([
'access_token' => 'eyJ...',
'refresh_token' => 'eyJ...',
]);