codebar-ag / laravel-microsoft-planner
This is my package laravel-microsoft-planner
Installs: 1 006
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: 8.2.*|8.3.*|8.4.*
- illuminate/contracts: ^12.0
- saloonphp/cache-plugin: ^3.0
- saloonphp/laravel-plugin: ^3.5
- saloonphp/saloon: ^3.10.1
- spatie/laravel-data: ^4.13.1
- spatie/laravel-package-tools: ^1.19
Requires (Dev)
- larastan/larastan: ^v3.1
- laravel/pint: ^1.21
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.7
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.39
This package is auto-updated.
Last update: 2025-03-03 09:13:44 UTC
README
This package was developed to interface with Microsoft Planner.
π‘ What is Laravel Microsoft Planner?
/ Laravel Microsoft Planner is an opinionated way to interface with Microsoft Planner.
π Requirements
Package | PHP | Laravel |
---|---|---|
v12.0.0 | ^8.2 - ^8.4 | 12.x |
v11.0.0 | ^8.2 - ^8.3 | 11.x |
v1.0.0 | ^8.1 - ^8.2 | 10.x |
βοΈ Installation
You can install the package via composer:
composer require codebar-ag/laravel-microsoft-planner
Add the following environment variables to your .env
file:
MICROSOFT_PLANNER_CLIENT_ID=your-client-id MICROSOFT_PLANNER_TENANT_ID=your-tenant-id MICROSOFT_PLANNER_CLIENT_SECRET=your-client-secret
π§ Configuration file
You can publish the config file with:
php artisan vendor:publish --tag=microsoft-planner-config
This is the contents of the published config file:
<?php // config for CodebarAg/LaravelMicrosoftPlanner return [ 'auth' => [ 'client_id' => env('LARAVEL_MICROSOFT_PLANNER_CLIENT_ID'), 'client_secret' => env('LARAVEL_MICROSOFT_PLANNER_CLIENT_SECRET'), 'tenant_id' => env('LARAVEL_MICROSOFT_PLANNER_TENANT_ID'), ] ];
π Usage
use CodebarAg\LaravelMicrosoftPlanner\Http\Connectors\MicrosoftPlannerConnector; use CodebarAg\LaravelMicrosoftPlanner\Http\Requests\Bucket\GetBucketTasksRequest; use CodebarAg\LaravelMicrosoftPlanner\Http\Requests\Tasks\GetTaskRequest; use CodebarAg\LaravelMicrosoftPlanner\Http\Requests\Tasks\GetTaskDetailsRequest; use CodebarAg\LaravelMicrosoftPlanner\Http\Requests\Tasks\PatchTaskRequest; use CodebarAg\LaravelMicrosoftPlanner\Http\Requests\Tasks\PatchTaskDetialsRequest; $connector = new MicrosoftPlannerConnector(); $authenticator = $connector->getAccessToken(); $connector->authenticate($authenticator);
// Get all tasks from a bucket $tasksResponse = $connector->send(new GetBucketTasksRequest(bucketId: 'bucket-id')); $tasks = $tasksResponse->dto();
// Get a single task $taskResponse = $connector->send(new GetTaskRequest(taskId: 'task-id')); $task = $taskResponse->dto();
// Get a tasks details $taskDetailsResponse = $connector->send(new GetTaskDetailsRequest(taskId: 'task-id')); $taskDetails = $taskDetailsResponse->dto();
// Update a task $updateTaskRequest = new PatchTaskRequest(taskId: 'task-id', etag: $task->eTag); $updateTaskRequest->body()->add('somedetail', 'somevalue'); $updateTaskResponse = $connector->send($updateTaskRequest); if ($updatedTask->successful()) { // Do something }
// Update a tasks details $updateTaskDetailsRequest = new PatchTaskDetialsRequest(taskId: 'task-id', etag: $taskDetails->eTag); $updateTaskDetailsRequest->body()->add('somedetail', 'somevalue'); $updateTaskDetailsResponse = $connector->send($updateTaskDetailsRequest); if ($updatedTaskDetails->successful()) { // Do something }
ποΈ DTO showcase
CodebarAg\LaravelMicrosoftPlanner\Data\Checklist { +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string +isChecked: true, // bool +title: "sometask" // string +orderHint: "858", // string +lastModifiedDateTime: "2021-08-31T13:00:00Z" // string +lastModifiedByUserId: "1234456" // string|null }
CodebarAg\LaravelMicrosoftPlanner\Data\Note { +contentType: 'html' // string +content: '<p>Some content</p>' // string }
CodebarAg\LaravelMicrosoftPlanner\Data\Reference { +alias: "test.pdf" // string +url: "https://something.here/in-this-file/test.pdf" // string +type: "pdf" // string +previewPriority: "858" // string +lastModifiedDateTime: "2021-08-31T13:00:00Z" // string +lastModifiedByUserId: "1234456" // string }
CodebarAg\LaravelMicrosoftPlanner\Data\TaskDetails { +eTag: "W/"1238934jbdf89bfdkkjbr34g98hh98vhhcc="" // string +description: "Some Description" // string +previewType: "noPreview" // string +id: "EZAPnP4uBkGAMqyd2dneWJcAOGbk" // string +notes: CodebarAg\LaravelMicrosoftPlanner\Data\Note // Note +references: Illuminate\Support\Collection // Collection +checklist: Illuminate\Support\Collection // Collection }
CodebarAg\LaravelMicrosoftPlanner\Data\Task { +eTag: "W/"JzEtVGFzsdfsdEBAQEBAQEBAQEBAQEBJcCc="" // string +planId: "aL8rSpzb_0-0IGcHql4P0ZcAG3_B" // string +bucketId: "09AEzJXp0E6zY5LEE2Wsv5cAOdQd" // string +title: "Task Title" // string +orderHint: "8585037232077788756Pe" // string +assigneePriority: "" // string +percentComplete: 100 // int +completed: true // bool +startDateTime: Carbon // Carbon\Carbon|null +createdDateTime: Carbon // Carbon\Carbon +dueDateTime: Carbon // Carbon\Carbon|null +recurrence: null // array|null +hasDescription: true // bool +specifiedCompletionRequirements: "none" // string +previewType: "noPreview" // string +completedDateTime: Carbon // Carbon\Carbon|null +completedBy: array // array +referenceCount: 2 // int +checklistItemCount: 3 // int +activeChecklistItemCount: 2 // int +conversationThreadId: "AAQkADk1ZG" // string|null +priority: 1 // int +creationSource: null // string|null +id: "EZAPnP4uBkGAMqyd2dneWJcAOGbk" // string +createdBy: array // array +appliedCategories: array // array +assignments: array // array
π§ Testing
Copy your own phpunit.xml-file.
cp phpunit.xml.dist phpunit.xml
Run the tests:
./vendor/bin/pest
π 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.