This package was developed to give you a quick start to the Miro API.
- What is Miro?
- Requirements
- Installation
- Laravel Boost Skill
- Usage
- API Reference
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Miro is an online collaborative whiteboard platform that enables teams to work effectively together, from brainstorming with digital sticky notes to planning and managing agile workflows.
| Package | PHP | Laravel |
|---|---|---|
| v0.1.1 | ^8.4 | ^12.0 | ^13.0 |
You can install the package via composer:
composer require codebar-ag/laravel-miroOptionally, you can publish the config file with:
php artisan vendor:publish --tag="laravel-miro-config"Add your Miro access token to your .env file:
MIRO_ACCESS_TOKEN=your_access_token_hereYou can generate a personal access token at miro.com/app/settings/user-profile/apps.
This package includes a Laravel Boost skill. If you use Laravel Boost in your project, the skill is automatically installed when you run:
php artisan boost:installThe skill provides AI agents with full context about the package β available methods, DTOs, response handling, and usage patterns.
All methods are available via the Miro facade and return a typed Response object.
use CodebarAg\Miro\Facades\Miro;
$response = Miro::getBoard('board_id');All *Response objects expose the following methods:
$response->successful(); // bool
$response->failed(); // bool
$response->status(); // int (e.g. 200, 404, 429)
$response->error(); // ?string β null on success
$response->errorCode(); // ?string β null on success
$response->dto(); // typed DTO or array of DTOs, null on failureCheck successful() before accessing the DTO β no try/catch needed for API errors like 404, 429, or 400.
$response = Miro::getBoard('board_id');
if ($response->successful()) {
$board = $response->dto(); // BoardDto
} else {
$response->status(); // e.g. 404
$response->error(); // e.g. "Board not found"
$response->errorCode(); // e.g. "board_not_found"
}We provide DTOs for the following:
| DTO | Fields |
|---|---|
BoardDto |
id, name, description, type, viewLink, teamId, projectId, createdAt, modifiedAt |
BoardItemDto |
id, type, data, position, geometry, createdAt, modifiedAt, parentId |
StickyNoteDto |
id, type, content, shape, fillColor, textAlign, textAlignVertical, positionX, positionY, width, height, parentId, createdAt, modifiedAt |
FrameDto |
id, type, title, fillColor, positionX, positionY, width, height, parentId, createdAt, modifiedAt |
use CodebarAg\Miro\Facades\Miro;
use CodebarAg\Miro\Dto\Boards\CreateBoardDto;
use CodebarAg\Miro\Dto\Boards\GetBoardsDto;
use CodebarAg\Miro\Dto\Boards\UpdateBoardDto;/**
* Get All Boards
*/
$response = Miro::getBoards();
$boards = $response->dto(); // BoardDto[]/**
* Get Boards With Filters
*/
$response = Miro::getBoards(new GetBoardsDto(
teamId: 'team_123',
limit: 10,
));/**
* Get A Board
*/
$response = Miro::getBoard('board_id');
$board = $response->dto(); // BoardDto/**
* Create A Board
*/
$response = Miro::createBoard(new CreateBoardDto(
name: 'My Sprint Board',
description: 'Q1 planning board',
));
$board = $response->dto(); // BoardDto/**
* Update A Board
*/
$response = Miro::updateBoard('board_id', new UpdateBoardDto(
name: 'Q1 Planning',
));
$board = $response->dto(); // BoardDto/**
* Delete A Board
*/
Miro::deleteBoard('board_id'); // returns Saloon\Http\Responseuse CodebarAg\Miro\Facades\Miro;
use CodebarAg\Miro\Dto\BoardItems\GetBoardItemsDto;/**
* Get All Items On A Board
*/
$response = Miro::getBoardItems('board_id');
$items = $response->dto(); // BoardItemDto[]/**
* Get Items Filtered By Type
*/
$response = Miro::getBoardItems('board_id', new GetBoardItemsDto(
type: 'sticky_note',
));/**
* Get A Board Item
*/
$response = Miro::getBoardItem('board_id', 'item_id');
$item = $response->dto(); // BoardItemDtouse CodebarAg\Miro\Facades\Miro;
use CodebarAg\Miro\Dto\StickyNotes\CreateStickyNoteDto;
use CodebarAg\Miro\Dto\StickyNotes\GetStickyNotesDto;
use CodebarAg\Miro\Dto\StickyNotes\UpdateStickyNoteDto;/**
* Get All Sticky Notes On A Board
*/
$response = Miro::getStickyNotes('board_id');
$notes = $response->dto(); // StickyNoteDto[]/**
* Get A Sticky Note
*/
$response = Miro::getStickyNote('board_id', 'item_id');
$note = $response->dto(); // StickyNoteDto/**
* Create A Sticky Note
*/
$response = Miro::createStickyNote('board_id', new CreateStickyNoteDto(
content: 'Hello World',
shape: 'square',
fillColor: 'yellow',
positionX: 100.0,
positionY: 200.0,
));
$note = $response->dto(); // StickyNoteDto/**
* Update A Sticky Note
*/
$response = Miro::updateStickyNote('board_id', 'item_id', new UpdateStickyNoteDto(
content: 'Updated content',
));
$note = $response->dto(); // StickyNoteDto/**
* Delete A Sticky Note
*/
Miro::deleteStickyNote('board_id', 'item_id'); // returns Saloon\Http\Responseuse CodebarAg\Miro\Facades\Miro;
use CodebarAg\Miro\Dto\Frames\CreateFrameDto;
use CodebarAg\Miro\Dto\Frames\GetFramesDto;
use CodebarAg\Miro\Dto\Frames\UpdateFrameDto;/**
* Get All Frames On A Board
*/
$response = Miro::getFrames('board_id');
$frames = $response->dto(); // FrameDto[]/**
* Get A Frame
*/
$response = Miro::getFrame('board_id', 'item_id');
$frame = $response->dto(); // FrameDto/**
* Create A Frame
*/
$response = Miro::createFrame('board_id', new CreateFrameDto(
title: 'Sprint 1',
positionX: 0.0,
positionY: 0.0,
width: 1920.0,
height: 1080.0,
));
$frame = $response->dto(); // FrameDto/**
* Update A Frame
*/
$response = Miro::updateFrame('board_id', 'item_id', new UpdateFrameDto(
title: 'Sprint 1 β Updated',
));
$frame = $response->dto(); // FrameDto/**
* Delete A Frame
*/
Miro::deleteFrame('board_id', 'item_id'); // returns Saloon\Http\Responsecomposer testTo run the live API tests against the real Miro API, set your token as an environment variable:
MIRO_ACCESS_TOKEN=your_access_token_here vendor/bin/pest --group=liveAlternatively, add it to .env.testing in the project root.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
