Download the PHP package buzkall/laravel-ticktick without Composer
On this page you can find all versions of the php package buzkall/laravel-ticktick. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download buzkall/laravel-ticktick
More information about buzkall/laravel-ticktick
Files in buzkall/laravel-ticktick
Package laravel-ticktick
Short Description A Laravel package to connect to TickTick API and manage tasks
License MIT
Homepage https://github.com/buzkall/ticktick
Informations about the package laravel-ticktick
TickTick Laravel Package
A Laravel package to connect to the TickTick API, authenticate, and interact with tasks. Built using the Spatie package skeleton structure.
Features
- ๐ OAuth2 authentication: authorization code, PKCE, or a personal API token
- โ Full Open API v1 coverage: tasks, projects, groups, columns, tags, habits, focus and countdowns
- ๐ Server-side task search and filtering
- ๐ฏ Task completion tracking
- ๐ Laravel service provider and facade
- โจ Clean and intuitive API
- ๐ Refresh token support
- ๐งช Test suite covering the HTTP layer
Requirements
- PHP 8.4 or higher
- Laravel 12 or 13
Installation
You can install the package via Composer:
Publish the configuration file:
Configuration
Add your TickTick API credentials to your .env file:
To obtain API credentials:
- Visit TickTick Developer Portal
- Create a new application
- Copy your Client ID and Client Secret
Usage
The API documentation is here: https://developer.ticktick.com/docs#/openapi
Authentication
Three options, simplest first.
Option A: Personal API token (no OAuth)
The quickest way to get going, and the only one that works in a headless environment. In the TickTick web app click your avatar, then Settings โ Account โ API Token, and create a token.
That token is sent exactly like an OAuth access token, so every method in this
package works with it and there is no browser round trip to arrange. This is the
same mechanism the official TickTick CLI uses for ticktick auth token <token>.
Option B: OAuth with PKCE (no client secret)
PKCE suits public clients that cannot keep a secret. Generate a verifier before redirecting, keep it in the session, and send it back on the callback.
Option C: OAuth authorization code (with client secret)
Step 1: Redirect user to TickTick authorization page
The client id, redirect uri and scope default to the values in
config/ticktick.php, so you only need to pass them to override the defaults.
If a random state is not provided, one is generated for you. Store it in the session so you can verify it in the callback.
Step 2: Handle the callback
Step 3: Refresh the access token when it expires
The refresh token also defaults to config('ticktick.refresh_token'), so
TickTick::refreshAccessToken() works without arguments when it is configured.
Working with Projects
Get all projects
Get a specific project
Get project data (including tasks)
Working with Tasks
Get all tasks for a project
Filter tasks by date
Create a new task
Get a specific task
Update a task
Delete a task
Complete a task
Searching and filtering tasks
TickTick can filter server-side, which avoids pulling a whole project down.
Note that today() and byDueDate() still filter client-side, since the API
has no single-day due-date filter; search() with dueFrom/dueTo is the
server-side equivalent for a range.
Moving tasks and comments
Managing projects, groups and columns
Tags, habits, focus and countdowns
Field formats
| Field | Values |
|---|---|
priority |
0 none, 1 low, 3 medium, 5 high |
status |
0 open, -1 abandoned, 2 completed |
viewMode |
list, kanban, timeline |
kind |
TASK, NOTE, CHECKLIST |
reminders[] |
TRIGGER(;RELATED=START\|END)?:(-)?Pโฆ e.g. TRIGGER:-PT60M, TRIGGER;RELATED=END:-PT15M |
repeatFlag |
A single RRULE: or ERULE: string, never both |
Focus type |
0 pomodoro, 1 timing |
Habit check-in stamp |
Ymd, e.g. 20260407 |
Using without Facade
Using Dependency Injection
API Reference
Authentication Methods
All arguments except $code and $state fall back to config/ticktick.php.
getAuthorizationUrl($clientId = null, $redirectUri = null, $scope = null, $state = '', $codeChallenge = null)- Generate authorization URL; pass a challenge for PKCEgeneratePkceChallenge()- Returns['code_verifier' => โฆ, 'code_challenge' => โฆ](S256)getAccessTokenFromPkceCode($code, $codeVerifier, $clientId = null, $redirectUri = null, $scope = null)- Exchange a PKCE code, no client secret sentgetAccessTokenFromCode($code, $clientId = null, $clientSecret = null, $redirectUri = null, $scope = null)- Exchange authorization code for access tokenrefreshAccessToken($refreshToken = null, $clientId = null, $clientSecret = null, $scope = null)- Exchange a refresh token for a new access tokensetAccessToken($token)/getAccessToken()- Set or read the access token used for API requestssetRefreshToken($token)/getRefreshToken()- Set or read the refresh token
Project Methods
projects()->all($params = [])- Get all projectsprojects()->get($projectId)- Get a specific projectprojects()->getData($projectId)- Get project data including all tasks and columnsprojects()->create($data)- Create a projectprojects()->update($projectId, $data)- Update a projectprojects()->delete($projectId)- Delete a project
Project Group Methods
projectGroups()->all()/create($data)/update($groupId, $data)/delete($groupId)
Column Methods
columns()->all($projectId)/create($projectId, $data)/update($projectId, $columnId, $data)
Task Methods
tasks()->all($projectId, $params = [])- Get all tasks for a specific projecttasks()->today($projectId, $timezone = null, $params = [])- Get tasks due today (client-side filtering)tasks()->byDueDate($projectId, $date, $timezone = null, $params = [])- Get tasks by due date in Y-m-d format (client-side filtering)tasks()->get($taskId, $projectId)- Get a specific tasktasks()->create($data)- Create a new tasktasks()->update($taskId, $projectId, $data)- Update a tasktasks()->delete($taskId, $projectId)- Delete a tasktasks()->complete($taskId, $projectId)- Mark task as completetasks()->move($moves)/moveTask($taskId, $from, $to)- Move tasks between projectstasks()->completed($projectIds, $startDate, $endDate)- Completed tasks in a rangetasks()->filter($projectIds, $startDate, $endDate, $priority, $tag, $status)- Server-side filtertasks()->search($keywords, $projectIds, $tags, $status, $dueFrom, $dueTo)- Server-side searchtasks()->comments($taskId, $projectId)/addComment(...)/deleteComment(...)
Tag Methods
tags()->all()/create($data)
Habit Methods
habits()->all()/get($habitId)/create($data)/update($habitId, $data)habits()->checkin($habitId, $data)/checkins($habitIds, $from, $to)
Focus Methods
focus()->all($from, $to, $type)/get($focusId, $type)/create($data)/delete($focusId, $type)
Countdown Methods
countdowns()->all()
Error handling
Every failure is thrown as a Arzcode\TickTick\Exceptions\TickTickException,
including connection failures and unparseable responses. When TickTick answered
with an HTTP error, the status code and raw body are available on the exception:
Testing
Run the tests with:
The suite mocks the Guzzle handler, so it asserts the exact requests the package sends to TickTick without hitting the network.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover any security-related issues, please email the maintainer instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.