11# AIssue for Laravel
22
3+ Basic and Lean Issue Management Package for Laravel
4+
35[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/aurorawebsoftware/aissue.svg?style=flat-square )] ( https://packagist.org/packages/aurorawebsoftware/aissue )
46[ ![ GitHub Tests Action Status] ( https://img.shields.io/github/workflow/status/aurorawebsoftware/aissue/run-tests?label=tests )] ( https://github.com/aurorawebsoftware/aissue/actions?query=workflow%3Arun-tests+branch%3Amain )
57[ ![ GitHub Code Style Action Status] ( https://img.shields.io/github/workflow/status/aurorawebsoftware/aissue/Check%20&%20fix%20styling?label=code%20style )] ( https://github.com/aurorawebsoftware/aissue/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain )
68[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/aurorawebsoftware/aissue.svg?style=flat-square )] ( https://packagist.org/packages/aurora/aissue )
79
8- Todo ....
910
1011# Features
1112
12- - Todo ...
13-
13+ - Basic Workflow and Issue Management
14+ - Limitless Issue Types
15+ - Limitless Statuses for Issue Types
16+ - Authenticatable Issue Status Transitions
17+ - Easy to Use and Lean
1418---
1519
1620
@@ -24,15 +28,15 @@ You can install the package via composer:
2428composer require aurorawebsoftware/aissue
2529```
2630
27- Todo
31+ You must add AIssueModelTrait Trait to the ** Issueable ** Model and The model must implement ** AIssueModelContract **
2832
2933``` php
30- use Illuminate\Foundation\Auth\User as Authenticatable ;
31- use AuroraWebSoftware\aissue \Traits\aissueUser ;
34+ use AuroraWebSoftware\AIssue\Contracts\AIssueModelContract ;
35+ use AuroraWebSoftware\AIssue \Traits\AIssueModelTrait ;
3236
33- class User extends Authenticatable
37+ class Issueable extends Model implements AIssueModelContract
3438{
35- use ;
39+ use AIssueModelTrait; ;
3640
3741 // ...
3842}
@@ -44,56 +48,103 @@ You can publish and run the migrations with:
4448php artisan migrate
4549```
4650
47- You can publish the sample data seeder with:
48-
49- ``` bash
50- php artisan vendor:publish --tag=" aissue-seeders"
51- php artisan db:seed --class=SampleDataSeeder
52- ```
53-
54- Optionally, You can seed the sample data with:
55-
56- ``` bash
57- php artisan db:seed --class=SampleDataSeeder
58- ```
59-
6051You can publish the config file with:
6152
6253``` bash
6354php artisan vendor:publish --tag=" aissue-config"
6455```
6556
6657This is the example contents of the published config file:
58+ ``` bash
6759
68- ``` php
69- return [
70- ];
60+ return [
61+ ' policyMethod' => fn ($permission ): bool => true,
62+ ' issueTypes' => [
63+ ' task' => [
64+ ' todo' => [' sort' => 1, ' permission' => ' todo_perm' ],
65+ ' in_progress' => [' sort' => 2, ' permission' => ' in_progress_perm' ],
66+ ' done' => [' sort' => 3, ' permission' => ' done_perm' ],
67+ ],
68+ ],
69+ ];
7170```
7271
73- # Main Philosophy
74- Todo
72+ ** Permission Config File**
73+
74+ Permissions are stored ` config/aissue.php ` is published after installing
7575
76- ---
77- > If you don't need organizational roles, ** aissue** may not be suitable for your work.
78- ---
7976
8077# Aissue Terminology
8178
82- Before using aissue its worth to understand the main terminology of aissue .
83- aissue differs from other Auth Packages due to its organizational structure.
79+ Before using AIssue its worth to understand the main terminology of AIssue .
80+ The difference of Issue from other packages is that it perform simple-level workflows with its simplified structure.
8481
8582
8683# Usage
8784
8885Before using this, please make sure that you published the config files.
8986
9087
91- ## aissue Service and Facade Methods
88+ ## AIssue Services, Service Provider and Facade
9289
93- ### todo
90+ // todo
9491
92+ ### Creating an Issuable
9593``` php
9694
95+ $createdModel = Issueable::create(
96+ ['name' => 'example isuable model']
97+ );
98+ ```
99+
100+ ### Making a transition for todo, in_progres and done
101+ ``` php
102+
103+ $createdModel = Issueable::create(
104+ ['name' => 'example isuable model']
105+ );
106+
107+ /** @var AIssue $createdIssueModel */
108+ $createdIssueModel = $createdModel->createIssue(1, 1, 'example', 'example isssue', 'example', 1, \Illuminate\Support\Carbon::now());
109+ //todo,in_progress,done
110+ $createdIssueModel->canMakeTransition('todo')
111+
112+ ```
113+
114+ ### Getting transitionable statuses
115+ ``` php
116+
117+ $createdModel = Issueable::create(
118+ ['name' => 'example isuable model 4']
119+ );
120+
121+ /** @var AIssue $createdIssueModel */
122+ $createdIssueModel = $createdModel->createIssue(1, 1, 'example', 'example isssue', 'example', 1, \Illuminate\Support\Carbon::now());
123+ $transitionable = $createdIssueModel->getTransitionableStatuses($createdIssueModel);
124+
125+ $this->assertTrue($transitionable == ["todo","in_progress"]);
126+
127+ ```
128+
129+ ### Using AIssue Interface and Trait with Eloquent Models
130+ To turn an Eloquent Model into an AIssue ;
131+ Model must implement AIssueModelContract and use AIssueModelTrait Trait.
132+ After adding AIssueModelContract trait, you will be able to use AIssue methods within the model
133+ ``` php
134+
135+ namespace App\Models\ExampleModel;
136+
137+ use AuroraWebSoftware\AIssue\Contracts\AIssueModelContract;
138+ use AuroraWebSoftware\AIssue\Traits\AIssueModelTrait;
139+ use Illuminate\Database\Eloquent\Model;
140+
141+ class ExampleModel extends Model implements AIssueModelContract
142+ {
143+ use AIssueModelTrait;
144+
145+ // implementation
146+ }
147+
97148```
98149
99150
@@ -107,7 +158,6 @@ Please see [CONTRIBUTING](README-contr.md) for details.
107158
108159## Security Vulnerabilities
109160
110- // todo ?
111161Please review [ our security policy] ( ../../security/policy ) on how to report security vulnerabilities.
112162
113163
0 commit comments