PHPackages                             buzkall/laravel-ticktick - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. buzkall/laravel-ticktick

ActiveLibrary[API Development](/categories/api)

buzkall/laravel-ticktick
========================

A Laravel package to connect to TickTick API and manage tasks

0.0.1(6mo ago)03MITPHPPHP ^8.2

Since Nov 8Pushed 6mo agoCompare

[ Source](https://github.com/buzkall/laravel-ticktick)[ Packagist](https://packagist.org/packages/buzkall/laravel-ticktick)[ Docs](https://github.com/buzkall/ticktick)[ RSS](/packages/buzkall-laravel-ticktick/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

TickTick Laravel Package
========================

[](#ticktick-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1095393118889080d316b5e4ae16bfb86bd1db602319f5174ecaa959096e446f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62757a6b616c6c2f7469636b7469636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/buzkall/ticktick)[![Total Downloads](https://camo.githubusercontent.com/7d378ba9fded165a677c31096e67dd3b3c5f6cfc793b0c7b29eaffda42c33488/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62757a6b616c6c2f7469636b7469636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/buzkall/ticktick)

A Laravel package to connect to the TickTick API, authenticate, and interact with tasks. Built using the Spatie package skeleton structure.

Features
--------

[](#features)

- 🔐 OAuth2 authentication flow
- ✅ Complete task management (create, read, update, delete)
- 🎯 Task completion tracking
- 🚀 Laravel service provider and facade
- ✨ Clean and intuitive API
- 🧪 Comprehensive test coverage

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require buzkall/ticktick
```

Publish the configuration file:

```
php artisan vendor:publish --tag=ticktick-config
```

Configuration
-------------

[](#configuration)

Add your TickTick API credentials to your `.env` file:

```
TICKTICK_CLIENT_ID=your_client_id
TICKTICK_CLIENT_SECRET=your_client_secret
TICKTICK_REDIRECT_URI=https://yourapp.com/ticktick/callback
TICKTICK_ACCESS_TOKEN=your_access_token (optional, if you already have one)
```

To obtain API credentials:

1. Visit [TickTick Developer Portal](https://developer.ticktick.com/)
2. Create a new application
3. Copy your Client ID and Client Secret

Usage
-----

[](#usage)

The API documentation is here:

### Authentication

[](#authentication)

#### Step 1: Redirect user to TickTick authorization page

[](#step-1-redirect-user-to-ticktick-authorization-page)

```
use Buzkall\TickTick\Facades\TickTick;

Route::get('/ticktick/auth', function () {
    $authUrl = TickTick::getAuthorizationUrl(
        config('ticktick.client_id'),
        config('ticktick.redirect_uri'),
        'tasks:read tasks:write', // Scopes
        'random_state_string' // State for CSRF protection
    );

    return redirect($authUrl);
});
```

#### Step 2: Handle the callback

[](#step-2-handle-the-callback)

```
Route::get('/ticktick/callback', function (Request $request) {
    $code = $request->get('code');

    $tokenData = TickTick::getAccessTokenFromCode(
        $code,
        config('ticktick.client_id'),
        config('ticktick.client_secret'),
        config('ticktick.redirect_uri')
    );

    // Store $tokenData['access_token'] in your database or session
    session(['ticktick_access_token' => $tokenData['access_token']]);

    return redirect('/dashboard');
});
```

### Working with Projects

[](#working-with-projects)

#### Get all projects

[](#get-all-projects)

```
use Buzkall\TickTick\Facades\TickTick;

// Set access token (if not already set in config)
TickTick::setAccessToken(session('ticktick_access_token'));

// Get all projects
$projects = TickTick::projects()->all();

// Each project has 'id' and 'name' properties
foreach ($projects as $project) {
    echo $project['name'] . ' (ID: ' . $project['id'] . ')';
}
```

#### Get a specific project

[](#get-a-specific-project)

```
$project = TickTick::projects()->get($projectId);
```

#### Get project data (including tasks)

[](#get-project-data-including-tasks)

```
// This returns complete project data including all tasks
$data = TickTick::projects()->getData($projectId);
$tasks = $data['tasks'];
```

### Working with Tasks

[](#working-with-tasks)

#### Get all tasks for a project

[](#get-all-tasks-for-a-project)

```
// Get all tasks for a specific project
$tasks = TickTick::tasks()->all($projectId);
```

#### Filter tasks by date

[](#filter-tasks-by-date)

```
// Get tasks due today (at any time)
$todayTasks = TickTick::tasks()->today($projectId);

// Get tasks due on a specific date
$tasks = TickTick::tasks()->byDueDate($projectId, '2025-01-15');

// Note: TickTick API doesn't support server-side filtering by date.
// These methods fetch all tasks and filter client-side.
```

#### Create a new task

[](#create-a-new-task)

```
$task = TickTick::tasks()->create([
    'title' => 'New Task',
    'content' => 'Task description',
    'projectId' => $projectId, // Required
    'priority' => 1, // 0: None, 1: Low, 3: Medium, 5: High
    'dueDate' => '2025-12-31T23:59:59+0000',
]);
```

#### Get a specific task

[](#get-a-specific-task)

```
$task = TickTick::tasks()->get($taskId, $projectId);
```

#### Update a task

[](#update-a-task)

```
$task = TickTick::tasks()->update($taskId, $projectId, [
    'title' => 'Updated Task Title',
    'status' => 0, // 0: Normal, 1: Completed
]);
```

#### Delete a task

[](#delete-a-task)

```
TickTick::tasks()->delete($taskId, $projectId);
```

#### Complete a task

[](#complete-a-task)

```
TickTick::tasks()->complete($taskId, $projectId);
```

### Using without Facade

[](#using-without-facade)

```
use Buzkall\TickTick\TickTick;

$ticktick = new TickTick([
    'access_token' => 'your_access_token',
    'base_url' => 'https://api.ticktick.com',
    'open_api_url' => 'https://api.ticktick.com/open/v1',
    'oauth_url' => 'https://ticktick.com',
    'timeout' => 30,
]);

$projects = $ticktick->projects()->all();
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use Buzkall\TickTick\TickTick;

class TaskController extends Controller
{
    public function __construct(private TickTick $ticktick)
    {
    }

    public function index()
    {
        $projects = $this->ticktick->projects()->all();
        return view('tasks.index', compact('projects'));
    }
}
```

API Reference
-------------

[](#api-reference)

### Authentication Methods

[](#authentication-methods)

- `getAuthorizationUrl($clientId, $redirectUri, $scope, $state)` - Generate authorization URL
- `getAccessTokenFromCode($code, $clientId, $clientSecret, $redirectUri)` - Exchange authorization code for access token
- `setAccessToken($token)` - Set the access token for API requests

### Project Methods

[](#project-methods)

- `projects()->all($params = [])` - Get all projects
- `projects()->get($projectId)` - Get a specific project
- `projects()->getData($projectId)` - Get project data including all tasks

### Task Methods

[](#task-methods)

- `tasks()->all($projectId, $params = [])` - Get all tasks for a specific project
- `tasks()->today($projectId, $params = [])` - Get tasks due today (client-side filtering)
- `tasks()->byDueDate($projectId, $date, $params = [])` - Get tasks by due date in Y-m-d format (client-side filtering)
- `tasks()->get($taskId, $projectId)` - Get a specific task
- `tasks()->create($data)` - Create a new task
- `tasks()->update($taskId, $projectId, $data)` - Update a task
- `tasks()->delete($taskId, $projectId)` - Delete a task
- `tasks()->complete($taskId, $projectId)` - Mark task as complete

Testing
-------

[](#testing)

Run the tests with:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security-related issues, please email the maintainer instead of using the issue tracker.

Credits
-------

[](#credits)

- [buzkall](https://github.com/buzkall)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance68

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

185d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26c36b79ed81995dd1326cb877e30a38fff6c397bfd8b16cf5685d8d1fc8ffd7?d=identicon)[buzkall](/maintainers/buzkall)

---

Top Contributors

[![buzkall](https://avatars.githubusercontent.com/u/5702?v=4)](https://github.com/buzkall "buzkall (4 commits)")

---

Tags

apilaravelproductivitytask managementticktick

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/buzkall-laravel-ticktick/health.svg)

```
[![Health](https://phpackages.com/badges/buzkall-laravel-ticktick/health.svg)](https://phpackages.com/packages/buzkall-laravel-ticktick)
```

###  Alternatives

[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[gufy/whmcs

WHMCS API for Laravel 5

201.7k](/packages/gufy-whmcs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
