marshmallow / laravel-linear
This is my package laravel-linear
Installs: 1 161
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 7
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/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-11-27 17:37:41 UTC
README
This package will allow you to connect your Laraval application with Linear via a Linear OAuth App.
Installation
You can install the package via composer:
composer require marshmallow/laravel-linear
After you've installed the package you can run the installation command. This command will publish the mandatory migrations and publish components and assets that are needed to show the beautifull Linear pages.
php artisan linear:install
Create your Linear OAuth App
Go to settings in you Linear account. In the account menu
, you will find the API button. Once you click on API
you will be able to create an OAuth application
. Click on Create New
.
Fill in all the field. The most importent part is the Callback URLs. You need to add you callback URL like your-domain.test/linear/oauth2/callback
. Add the callback url for all your domains. Local, Beta and Production so it will work on all your sites.
When you've create your app, you will get a Client id
and a Client secret
. Copy these, we need them later!
Usage
Using this package is super easy. We just need to make two minor updates to your application.
Update your .env file
When you created your Linear OAuth Application you got a Client id
and a Client secret
. You need to add them to your .env
file.
LINEAR_CLIENT_ID="____YOUR_CLIENT_ID____" LINEAR_CLIENT_SECRET="____YOUR_CLIENT_SECRET____"
Update your Authenticatable model
First you need to be logged in to your application. This is so not everybody can change the connection to Linear.
On your Authenticatable model, usually the User model, you need to implement one new method to let the package know who can manage the Linear connection. Add the method below.
class User extends Authenticatable { // ... public function allowedToManagerLinearConnection(): bool { return in_array($this->email, [ 'stef@marshmallow.dev', ]); } }
Go to your-domain.test/linear/auth
and follow the steps to connect your Laraval application to Linear. After you've done this you will be able to connect a company, team and project.
Submit your first issue
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));
Using the notification channel
Change the settings.
When you go to your-domain.test/linear/auth
after you've connected to linear you will be able to change the config.
Updating
When you install a new version of this package via Composer it might be helpfull to run the update command so all the views and assets are up to date. This command will publish the latest assets for this package and publish new components if they are available.
php artisan linear:update
Linear
Here are some documentation pages from Linear that might be helpfull.
https://developers.linear.app/docs/oauth/authentication https://developers.linear.app/docs/oauth/oauth-actor-authorization
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.