|
1 | | -# AIssue for Laravel |
| 1 | +# **Laravel AIssue Package** |
2 | 2 |
|
3 | | -Basic and Lean Issue Management Package for Laravel |
| 3 | +The Laravel AIssue package provides a comprehensive solution for managing issues within your Laravel applications. Built with flexibility and extensibility in mind, it integrates seamlessly with Laravel's Eloquent ORM, offering a rich set of features to handle issue tracking, state management, and connections between different models. |
4 | 4 |
|
5 | | -[](https://packagist.org/packages/aurorawebsoftware/aissue) |
6 | | -[](https://github.com/aurorawebsoftware/aissue/actions?query=workflow%3Arun-tests+branch%3Amain) |
7 | | -[](https://github.com/aurorawebsoftware/aissue/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) |
8 | | -[](https://packagist.org/packages/aurora/aissue) |
| 5 | +## **Features** |
9 | 6 |
|
| 7 | +- **Customizable Issue Tracking**: Track issues with customizable fields, descriptions, summaries, and timestamps. |
| 8 | +- **Workflow Integration**: Utilize the ArFlow package for state management of issues, allowing for complex workflows with multiple states and transitions. |
| 9 | +- **Dynamic Relationships**: Leverage the Connective package for dynamic relationships between issues and various actors (e.g., reporters, responsible parties, observers). |
| 10 | +- **Event Management**: Incorporate event management for issues, including setting due dates and reminders, through integration with the ACalendar package. |
| 11 | +- **Extensible and Modular**: Designed with modularity in mind, allowing for easy extension and customization to fit your application's specific needs. |
10 | 12 |
|
11 | | -# Features |
12 | | - |
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 |
18 | | ---- |
19 | | - |
20 | | - |
21 | | -[<img src="https://banners.beyondco.de/AIssue.png?theme=light&packageManager=composer+require&packageName=aurorawebsoftware%2Faissue&pattern=architect&style=style_1&description=Model+Issue+Management+Package&md=1&showWatermark=0&fontSize=100px&images=check-circle" />](https://github.com/AuroraWebSoftware/Aissue) |
22 | | - |
23 | | -# Installation |
| 13 | +## **Installation** |
24 | 14 |
|
25 | 15 | You can install the package via composer: |
26 | 16 |
|
27 | 17 | ```bash |
28 | | -composer require aurorawebsoftware/aissue |
29 | | -``` |
| 18 | +bashCopy code |
| 19 | +composer require aurorawebsolutions/aissue |
30 | 20 |
|
31 | | -You must add AIssueModelTrait Trait to the **Issueable** Model and The model must implement **AIssueModelContract** |
32 | | - |
33 | | -```php |
34 | | -use AuroraWebSoftware\AIssue\Contracts\AIssueModelContract; |
35 | | -use AuroraWebSoftware\AIssue\Traits\AIssueModelTrait; |
36 | | - |
37 | | -class Issueable extends Model implements AIssueModelContract |
38 | | -{ |
39 | | - use AIssueModelTrait; |
40 | | - |
41 | | - // ... |
42 | | -} |
43 | 21 | ``` |
44 | 22 |
|
45 | | -You can publish and run the migrations with: |
| 23 | +After installation, publish and run the migrations with: |
46 | 24 |
|
47 | 25 | ```bash |
| 26 | +bashCopy code |
| 27 | +php artisan vendor:publish --provider="AuroraWebSoftware\AIssue\AIssueServiceProvider" --tag="migrations" |
48 | 28 | php artisan migrate |
49 | | -``` |
50 | 29 |
|
51 | | -You can publish the config file with: |
52 | | - |
53 | | -```bash |
54 | | -php artisan vendor:publish --tag="aissue-config" |
55 | | -``` |
56 | | - |
57 | | -This is the example contents of the published config file: |
58 | | -```bash |
59 | | - |
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 | | - ]; |
70 | 30 | ``` |
71 | 31 |
|
72 | | -**Permission Config File** |
73 | | - |
74 | | -Permissions are stored `config/aissue.php` is published after installing |
75 | | - |
76 | | - |
77 | | -# Aissue Terminology |
78 | | - |
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. |
81 | | - |
| 32 | +## **Usage** |
82 | 33 |
|
83 | | -# Usage |
| 34 | +### **Basic Concepts** |
84 | 35 |
|
85 | | -Before using this, please make sure that you published the config files. |
| 36 | +Before diving into the code, it's essential to understand the main components of the AIssue package: |
86 | 37 |
|
| 38 | +- **Issues**: The central entity representing a problem or task that needs to be addressed. |
| 39 | +- **Actors**: Entities such as users who interact with issues in different capacities (e.g., reporter, responsible party). |
| 40 | +- **Workflow States**: Define the lifecycle of an issue through various states (e.g., open, in progress, closed). |
87 | 41 |
|
88 | | -## AIssue Services, Service Provider and Facade |
| 42 | +### **Defining and Managing Issues** |
89 | 43 |
|
| 44 | +Create a new issue: |
90 | 45 |
|
91 | | -## Terminology |
92 | | - |
93 | | -**policyMethod** : It is the definition that provides authorization check before reaching the Issuable. |
94 | | - |
95 | | -**IssueType** : IssueType is Workflow type's name determined by system authority. |
96 | | - |
97 | | -**transition** : transition is changing of type example(todo,in_progres,done,etc). |
98 | | - |
99 | | -**status** : status is IssueModel's current type type example(todo,in_progres,done,etc). |
100 | | - |
101 | | -**Issueable** : Issueable is an model that contains makeTransition,canMakeTransition,getTransitionableStatuses functions and workflow information. |
| 46 | +```php |
| 47 | +phpCopy code |
| 48 | +use AuroraWebSoftware\AIssue\Models\AIssue; |
102 | 49 |
|
| 50 | +$issue = AIssue::create([ |
| 51 | + 'summary' => 'Example issue', |
| 52 | + 'description' => 'Detailed description of the issue', |
| 53 | +]); |
103 | 54 |
|
| 55 | +// Apply a predefined workflow |
| 56 | +$issue->applyWorkflow('simple'); |
104 | 57 |
|
| 58 | +``` |
105 | 59 |
|
| 60 | +Add actors to an issue: |
106 | 61 |
|
107 | | -### Creating an Issuable |
108 | 62 | ```php |
| 63 | +phpCopy code |
| 64 | +// Assuming $user1 and $user2 are instances of a Model that implements IssueActorModelContract |
| 65 | +$issue->setReporter($user1); // Set the reporter |
| 66 | +$issue->setResponsible($user2); // Set the responsible party |
109 | 67 |
|
110 | | -$createdModel = Issueable::create( |
111 | | - ['name' => 'example isuable model'] |
112 | | - ); |
113 | 68 | ``` |
114 | 69 |
|
115 | | -### MakeTransition function in AIssueModel is making transformation for todo,in_progress,done |
116 | | -```php |
117 | | - |
118 | | - |
119 | | - $createdModel = Issueable::create( |
120 | | - ['name' => 'test isuable model '] |
121 | | - ); |
122 | | - |
123 | | - /** @var AIssue $createdIssueModel */ |
124 | | - $createdIssueModel = $createdModel->createIssue(1, 1, 'task', 'test isssue 2.1', 'asdf', 1, \Illuminate\Support\Carbon::now()); |
125 | | - |
126 | | - $transition = $createdIssueModel->makeTransition('in_progress'); |
| 70 | +Manage issue states: |
127 | 71 |
|
128 | | - |
129 | | -``` |
130 | | - |
131 | | -### canMakeTransition function in AIssueModel is checking policyMethod permission from config file |
132 | 72 | ```php |
| 73 | +phpCopy code |
| 74 | +// Transition to another state |
| 75 | +$issue->transitionTo('state2'); |
133 | 76 |
|
134 | | - $createdModel = Issueable::create( |
135 | | - ['name' => 'example isuable model'] |
136 | | - ); |
137 | | - |
138 | | - /** @var AIssue $createdIssueModel */ |
139 | | - $createdIssueModel = $createdModel->createIssue(1, 1, 'example', 'example isssue', 'example', 1, \Illuminate\Support\Carbon::now()); |
140 | | - |
141 | | - $createdIssueModel->canMakeTransition('todo') |
| 77 | +// Check current state |
| 78 | +$currentState = $issue->currentState(); |
142 | 79 |
|
143 | 80 | ``` |
144 | 81 |
|
145 | | -### getTransitionableStatuses function in AIssueModel is getting transitionable statustes from config file if it is got any permission |
146 | | -```php |
| 82 | +### **Working with Connectives and Observers** |
147 | 83 |
|
148 | | - $createdModel = Issueable::create( |
149 | | - ['name' => 'example isuable model 4'] |
150 | | - ); |
| 84 | +```php |
| 85 | +phpCopy code |
| 86 | +// Add observers to an issue |
| 87 | +$issue->addObserver($user3); |
| 88 | +$issue->addObserver($user4); |
151 | 89 |
|
152 | | - /** @var AIssue $createdIssueModel */ |
153 | | - $createdIssueModel = $createdModel->createIssue(1, 1, 'example', 'example isssue', 'example', 1, \Illuminate\Support\Carbon::now()); |
154 | | - $transitionable = $createdIssueModel->getTransitionableStatuses($createdIssueModel); |
| 90 | +// Remove an observer |
| 91 | +$issue->removeObserver($user3); |
155 | 92 |
|
| 93 | +// Remove all observers |
| 94 | +$issue->removeAllObservers(); |
156 | 95 |
|
157 | 96 | ``` |
158 | 97 |
|
159 | | -### Using AIssue Interface and Trait with Eloquent Models |
160 | | -To turn an Eloquent Model into an AIssue ; |
161 | | -Model must implement AIssueModelContract and use AIssueModelTrait Trait. |
162 | | -After adding AIssueModelContract trait, you will be able to use AIssue methods within the model |
| 98 | +### **Setting and Managing Due Dates** |
| 99 | + |
163 | 100 | ```php |
| 101 | +phpCopy code |
| 102 | +use Illuminate\Support\Carbon; |
164 | 103 |
|
165 | | - namespace App\Models\ExampleModel; |
| 104 | +// Set a due date for the issue |
| 105 | +$issue->setDueDate(Carbon::today()); |
166 | 106 |
|
167 | | - use AuroraWebSoftware\AIssue\Contracts\AIssueModelContract; |
168 | | - use AuroraWebSoftware\AIssue\Traits\AIssueModelTrait; |
169 | | - use Illuminate\Database\Eloquent\Model; |
170 | | - |
171 | | - class ExampleModel extends Model implements AIssueModelContract |
172 | | - { |
173 | | - use AIssueModelTrait; |
174 | | - |
175 | | - // implementation |
176 | | -} |
| 107 | +// Remove the due date |
| 108 | +$issue->removeDueDate(); |
177 | 109 |
|
178 | 110 | ``` |
179 | 111 |
|
| 112 | +## **Advanced Usage** |
180 | 113 |
|
181 | | -## Changelog |
| 114 | +The AIssue package supports more advanced features and integrations, allowing for a highly customizable issue tracking system. For more details on these advanced features, please refer to the comprehensive documentation. |
182 | 115 |
|
183 | | -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. |
| 116 | +## **Contributing** |
184 | 117 |
|
185 | | -## Contributing |
| 118 | +Contributions are welcome and will help make AIssue even better. If you're interested in contributing, please check out the contributing guide. |
186 | 119 |
|
187 | | -Please see [CONTRIBUTING](README-contr.md) for details. |
| 120 | +## **License** |
188 | 121 |
|
189 | | -## Security Vulnerabilities |
| 122 | +The Laravel AIssue package is open-sourced software licensed under the [MIT license](https://chat.openai.com/g/g-8MaB2KpKn-laravel-developer/c/LICENSE.md). |
190 | 123 |
|
191 | | -Please review [our security policy](../../security/policy) on how to report security vulnerabilities. |
192 | | - |
193 | | - |
194 | | -## Credits |
195 | | - |
196 | | -- [Aurora Web Software Team](https://github.com/AuroraWebSoftware) |
197 | | -- [All Contributors](../../contributors) |
198 | | - |
199 | | -## License |
| 124 | +--- |
200 | 125 |
|
201 | | -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
| 126 | +This README provides a solid foundation for your Laravel AIssue package, outlining its capabilities, how to get started, and how to use its main features. You can further customize and expand it based on the specific details and additional functionalities of your package. |
0 commit comments