codebar-ag / laravel-miro
A simple way to interact with the Miro API in Laravel
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/contracts: ^12.0|^13.0
- saloonphp/laravel-plugin: ^4.0
- saloonphp/saloon: ^4.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.1|^9.0
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2026-03-26 07:17:05 UTC
README
This package was developed to give you a quick start to the Miro API.
π Table of Contents
- What is Miro?
- Requirements
- Installation
- Laravel Boost Skill
- Usage
- API Reference
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
π‘ What is Miro?
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.
π Requirements
| Package | PHP | Laravel |
|---|---|---|
| v0.1.1 | ^8.4 | ^12.0 | ^13.0 |
βοΈ Installation
You can install the package via composer:
composer require codebar-ag/laravel-miro
Optionally, 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_here
You can generate a personal access token at miro.com/app/settings/user-profile/apps.
π€ Laravel Boost Skill
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:install
The skill provides AI agents with full context about the package β available methods, DTOs, response handling, and usage patterns.
π Usage
All methods are available via the Miro facade and return a typed Response object.
use CodebarAg\Miro\Facades\Miro; $response = Miro::getBoard('board_id');
Response Handling
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 failure
Check 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" }
DTOs
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 |
API Reference
Boards
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\Response
Board Items
use 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(); // BoardItemDto
Sticky Notes
use 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\Response
Frames
use 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\Response
π§ͺ Testing
composer test
To 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=live
Alternatively, add it to .env.testing in the project root.
π Changelog
Please see CHANGELOG for more information on what has changed recently.
βοΈ Contributing
Please see CONTRIBUTING for details.
ποΈ Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
π Credits
π License
The MIT License (MIT). Please see License File for more information.