PHPackages                             softdd/tasks - 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. softdd/tasks

ActiveLibrary[API Development](/categories/api)

softdd/tasks
============

任务类

v1.02(5y ago)013MITPHPPHP &gt;=7.0.0

Since Apr 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/phper5/laravelTask)[ Packagist](https://packagist.org/packages/softdd/tasks)[ RSS](/packages/softdd-tasks/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

softdd/task
===========

[](#softddtask)

任务管理类

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

[](#installation)

```
composer require softdd/task
php artisan vendor:publish --provider="SoftDD\Task\TaskServiceProvider"
```

Usage
-----

[](#usage)

自定义类，扩展Task的功能 自定义类，扩展TaskController的功能

### 配置说明

[](#配置说明)

```
//softDDTask.php
return [
    'model'=>\SoftDD\Task\Task::class,
    'controller'=>\SoftDD\Task\TaskController::class,
    'error'=>\SoftDD\Task\ErrorNum::class,
    'status'=>\SoftDD\Task\TaskStatus::class,
    'defaultService'=>'default',
    'response'=>\SoftDD\Task\Response::class,
    'callbackUrl'=>config('app.url').'/api/callback/task/finished',
    'postTaskUri'=>'/api/tasks'
];
```

todo:

- migration

task

\--- | :--- | :--- status | int ｜ 状态 0初始 10准备好可以开始 20开始 30结束 -10错误 progress | int ｜ 进度 taskId | string ｜任务id service | string ｜服务类型 input | text ｜任务的输入 如oss id args | text ｜参数 temp ｜ text ｜ 中间的info output | text ｜任务的输出 入oss id

```
/**
     * @OA\Get(
     *     path="/api/tasks/{taskId}",
     *     @OA\Response(
     *       response="404",
     *       description="没有"
     *     ),
     *     @OA\Response(
     *     response=200,
     *     description="successful operation",
     *     @OA\MediaType(
     *         mediaType="application/json",
     *         @OA\Schema(ref="#/components/schemas/task"),
     *     )
     *     ),
     * )

     * @OA\Put(
     *     path="/api/tasks/{taskId}",
     *     @OA\RequestBody(
     *         @OA\MediaType(
     *             mediaType="multipart/form-data",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     description="任务参数",
     *                     property="args",
     *                     type="string",
     *                     format="string",
     *                 ),
     *                 @OA\Property(
     *                     description="任务数据",
     *                     property="input",
     *                     type="string"
     *                 ),
     *                 required={"input"}
     *             ),
     *         ),
     *     ),
     *     @OA\Response(
     *       response="404",
     *       description="没有"
     *     ),
     *     @OA\Response(
     *     response=200,
     *     description="successful operation",
     *     @OA\MediaType(
     *         mediaType="application/json",
     *         @OA\Schema(ref="#/components/schemas/task"),
     *     )
     *     ),
     * )
    * 创建一个任务
     * @OA\Post(
     *     path="/api/tasks",
     *     @OA\RequestBody(
     *         @OA\MediaType(
     *             mediaType="multipart/form-data",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     description="任务参数",
     *                     property="args",
     *                     type="string",
     *                     format="string",
     *                 ),
     *                 @OA\Property(
     *                     description="任务数据",
     *                     property="input",
     *                     type="string"
     *                 ),
     *                 @OA\Property(
     *                     description="服务类型",
     *                     property="service",
     *                     type="string"
     *                 ),
     *                 required={"input"}
     *             ),
     *         ),
     *     ),
     *     @OA\Response(
     *       response="430",
     *       description="没有权限"
     *     ),
     *     @OA\Response(
     *     response=200,
     *     description="successful operation",
     *     @OA\MediaType(
     *         mediaType="application/json",
     *         @OA\Schema(ref="#/components/schemas/task"),
     *     )
     *     ),
     * )
     * @OA\Get(
     *     path="/api/tasks",
     *     @OA\RequestBody(
     *         @OA\MediaType(
     *             mediaType="multipart/form-data",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     description="页数",
     *                     property="page",
     *                     type="integer",
     *                 ),
     *                 @OA\Property(
     *                     description="每页数量",
     *                     property="pageNum",
     *                     type="integer",
     *                 ),
     *                 @OA\Property(
     *                     description="服务类型",
     *                     property="service",
     *                     type="string"
     *                 ),
     *                 required={"input"}
     *             ),
     *         ),
     *     ),
     *     @OA\Response(
     *       response="430",
     *       description="没有权限"
     *     ),
     *     @OA\Response(
     *     response=200,
     *     description="successful operation",
     *     @OA\MediaType(
     *         mediaType="application/json",
     *         @OA\Schema(ref="#/components/schemas/task"),
     *     )
     *     ),
     * )
     * 读取任务列表
     * 后台读取一个需要处理的任务 根据service taskId group进行筛选 status=10的
     * @OA\Get(
     *     path="/api/crontask",
     *     @OA\Response(
     *     response=200,
     *     description="successful operation",
     *     @OA\MediaType(
     *         mediaType="application/json",
     *         @OA\Schema(ref="#/components/schemas/cronTask"),
     *     )
     *     ),
     * )
      * 后台更新任务状态
     * @OA\Put(
     *     path="/api/crontask/{taskId}",
     *     @OA\RequestBody(
     *         @OA\MediaType(
     *             mediaType="multipart/form-data",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     description="进度",
     *                     property="progress",
     *                     type="integer",
     *                 ),
     *                 @OA\Property(
     *                     description="状态",
     *                     property="status",
     *                     type="integer",
     *                 ),
     *                 @OA\Property(
     *                     description="中间数据",
     *                     property="temp",
     *                     type="string"
     *                 ),
     *                 @OA\Property(
     *                     description="结果",
     *                     property="output",
     *                     type="string"
     *                 ),
     *                 required={"input"}
     *             ),
     *         ),
     *     ),
     *     @OA\Response(
     *     response=200,
     *     description="successful operation",
     *     @OA\MediaType(
     *         mediaType="application/json",
     *         @OA\Schema(ref="#/components/schemas/cronTask"),
     *     )
     *     ),
     * )
     *  CronTask
     * @OA\Property(
     *     @OA\Property(
     *      property="callbackUrl",
     *      type="string",
     *      description="callbackUrl"
     *      ),
     *    @OA\Property(
     *      property="taskId",
     *      type="string",
     *      ),
     *     @OA\Property(
     *      property="status",
     *      type="integer",
     *      ),
     *     @OA\Property(
     *      property="service",
     *      type="string",
     *      ),
     *     @OA\Property(
     *      property="progress",
     *      type="integer",
     *      ),
     *     @OA\Property(
     *      property="input",
     *      type="string",
     *      ),
     *     @OA\Property(
     *      property="output",
     *      type="string",
     *      )
     * )
     class Task
{
    /**
     * 任务id
     * @var string
     * @OA\Property()
     */
    public $taskId;

    /**
     *
     * @var integer
     * @OA\Property()
     */
    protected $status;

    /**
     * @var integer
     * @OA\Property ()
     */
    protected $progress;
    /**
     * @var string
     * @OA\Property ()
     */
    protected $service;
    /**
     * @var string
     * @OA\Property ()
     */
    protected $args;
    /**
     * @var string
     * @OA\Property ()
     */
    protected $input;
    /**
     * @var string
     * @OA\Property ()
     */
    protected $output;
}

```

- migration

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Every ~19 days

Total

4

Last Release

1853d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29189650?v=4)[phper5](/maintainers/phper5)[@phper5](https://github.com/phper5)

---

Top Contributors

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

---

Tags

swaggertasksoftdd

### Embed Badge

![Health badge](/badges/softdd-tasks/health.svg)

```
[![Health](https://phpackages.com/badges/softdd-tasks/health.svg)](https://phpackages.com/packages/softdd-tasks)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M134](/packages/darkaonline-l5-swagger)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M63](/packages/knuckleswtf-scribe)[wotz/laravel-swagger-ui

Add Swagger UI to a Laravel application.

279417.8k](/packages/wotz-laravel-swagger-ui)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[ronasit/laravel-swagger

Provided middleware for generating of swagger-documentation file by run testing of restful API.

180132.3k2](/packages/ronasit-laravel-swagger)

PHPackages © 2026

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