marshmallow / laravel-linear
这是我创建的包laravel-linear
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0
- laravel/socialite: ^5.5
- livewire/livewire: ^2.10
- marshmallow/components: ^1.0
- motomedialab/laravel-vite-helper: ^1.2
- spatie/laravel-package-tools: ^1.13.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0|^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
- dev-main
- v1.4.1
- v1.4.0
- 1.3.1
- v1.3.0
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/npm_and_yarn/multi-d55b26395c
- dev-dependabot/github_actions/dependabot/fetch-metadata-2.2.0
- dev-dependabot/github_actions/ramsey/composer-install-3
- dev-dependabot/github_actions/aglipanci/laravel-pint-action-2.3.1
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-5
- dev-dependabot/github_actions/actions/checkout-4
- dev-17-make-sure-it-works-with-an-empty-description
- dev-13-should-be-possible-to-add-the-project-id-to-the-issue-you-are-creating
This package is auto-updated.
Last update: 2024-09-24 20:15:31 UTC
README
此包允许您通过Linear OAuth App将您的Laraval应用程序与Linear连接。
安装
您可以通过composer安装此包。
composer require marshmallow/laravel-linear
安装包后,您可以使用安装命令。此命令将发布必需的迁移,并发布显示美观的Linear页面所需的组件和资源。
php artisan linear:install
创建您的Linear OAuth App
转到您的Linear账户设置。在账户菜单
中,您将找到API按钮。点击API
后,您将能够创建一个OAuth应用程序
。点击创建新
。
填写所有字段。最重要的部分是回调URL。您需要添加您的回调URL,例如your-domain.test/linear/oauth2/callback
。添加所有域的回调URL,包括本地、测试和生产,以确保所有网站都能工作。
创建您的应用程序后,您将获得一个Client id
和一个Client secret
。复制这些,我们稍后会用到它们!
用法
使用此包非常简单。我们只需要对您的应用程序进行两个小的更新。
更新您的.env文件
当您创建Linear OAuth应用程序时,您将获得一个Client id
和一个Client secret
。您需要将它们添加到您的.env
文件中。
LINEAR_CLIENT_ID="____YOUR_CLIENT_ID____" LINEAR_CLIENT_SECRET="____YOUR_CLIENT_SECRET____"
更新您的Authenticatable模型
首先,您需要登录到您的应用程序。这样,不是每个人都能够更改与Linear的连接。
在您的Authenticatable模型中,通常是User模型,您需要实现一个新方法,以便让包知道谁可以管理Linear连接。添加以下方法。
class User extends Authenticatable { // ... public function allowedToManagerLinearConnection(): bool { return in_array($this->email, [ 'stef@marshmallow.dev', ]); } }
转到your-domain.test/linear/auth
,并按照步骤连接您的Laraval应用程序到Linear。完成此操作后,您将能够连接公司、团队和项目。
提交您的问题
use App\Models\User; use LaravelLinear\Notifications\NewLinearIssue; use LaravelLinear\Notifications\Messages\LinearIssue; $issue = (new LinearIssue) ->title('Issue title') ->message('Issue message'); $user = User::first(); $user->notify(new NewLinearIssue($issue));
使用通知渠道
更改设置。
当您连接到Linear并转到your-domain.test/linear/auth
后,您将能够更改配置。
更新
当您通过Composer安装此包的新版本时,运行更新命令可能很有用,以确保所有视图和资源都最新。此命令将发布此包的最新资源,并发布新组件(如果可用)。
php artisan linear:update
Linear
以下是Linear的一些可能有帮助的文档页面。
https://developers.linear.app/docs/oauth/authentication https://developers.linear.app/docs/oauth/oauth-actor-authorization
测试
composer test
更新日志
有关最近更改的更多信息,请参阅更新日志。
贡献
有关详细信息,请参阅贡献。
安全漏洞
请查看我们的安全策略,了解如何报告安全漏洞。
鸣谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。