michal78/laravel-tasks

Laravel的简单任务管理

1.0.0.2 2023-05-31 08:30 UTC

README

Latest Version on Packagist Total Downloads GitHub Actions

安装

您可以通过composer安装此包

composer require michal78/laravel-tasks

使用

// Add the HasTasks trait to your model
use Michal78\LaravelTasks\Traits\HasTasks;

class User extends Model
{
    use HasTasks;
}

// Create a task
$user->addTask(
    [
        'name' => 'My task',
        'description' => 'My task description',
        'priority' => 2,
        'due_date' => now()->addDays(7),
    ]
);

// Get all tasks
$user->tasks;

// Get all tasks that are not completed
$user->tasks()->notCompleted()->get();

// Get all tasks that are completed
$user->tasks()->completed()->get();

// Get all tasks that are completed and have a due date in the future
$user->tasks()->completed()->future()->get();

测试(尚未实现)

composer test

变更日志

有关最近更改的更多信息,请参阅变更日志

贡献

有关详细信息,请参阅贡献指南

安全

如果您发现任何安全相关问题,请通过michal.skogemann@gmail.com发送电子邮件,而不是使用问题跟踪器。

鸣谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件