Skip to content

Commit 0adb39d

Browse files
authored
Merge pull request #22 from AuroraWebSoftware/v2-dev2
- v2
2 parents f3bbb18 + 230fc54 commit 0adb39d

File tree

2 files changed

+70
-145
lines changed

2 files changed

+70
-145
lines changed

README-todo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
- dökümantasyon v2 ye göre güncellenecek
22
- event reminders meselesi ve event içine like ile arama ekleme
3-
- phpstan
3+
- test için usuable modeller

README.md

Lines changed: 69 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,201 +1,126 @@
1-
# AIssue for Laravel
1+
# **Laravel AIssue Package**
22

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.
44

5-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/aurorawebsoftware/aissue.svg?style=flat-square)](https://packagist.org/packages/aurorawebsoftware/aissue)
6-
[![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)
7-
[![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)
8-
[![Total Downloads](https://img.shields.io/packagist/dt/aurorawebsoftware/aissue.svg?style=flat-square)](https://packagist.org/packages/aurora/aissue)
5+
## **Features**
96

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.
1012

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**
2414

2515
You can install the package via composer:
2616

2717
```bash
28-
composer require aurorawebsoftware/aissue
29-
```
18+
bashCopy code
19+
composer require aurorawebsolutions/aissue
3020

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-
}
4321
```
4422

45-
You can publish and run the migrations with:
23+
After installation, publish and run the migrations with:
4624

4725
```bash
26+
bashCopy code
27+
php artisan vendor:publish --provider="AuroraWebSoftware\AIssue\AIssueServiceProvider" --tag="migrations"
4828
php artisan migrate
49-
```
5029

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-
];
7030
```
7131

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**
8233

83-
# Usage
34+
### **Basic Concepts**
8435

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:
8637

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).
8741

88-
## AIssue Services, Service Provider and Facade
42+
### **Defining and Managing Issues**
8943

44+
Create a new issue:
9045

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;
10249

50+
$issue = AIssue::create([
51+
'summary' => 'Example issue',
52+
'description' => 'Detailed description of the issue',
53+
]);
10354

55+
// Apply a predefined workflow
56+
$issue->applyWorkflow('simple');
10457

58+
```
10559

60+
Add actors to an issue:
10661

107-
### Creating an Issuable
10862
```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
10967

110-
$createdModel = Issueable::create(
111-
['name' => 'example isuable model']
112-
);
11368
```
11469

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:
12771

128-
129-
```
130-
131-
### canMakeTransition function in AIssueModel is checking policyMethod permission from config file
13272
```php
73+
phpCopy code
74+
// Transition to another state
75+
$issue->transitionTo('state2');
13376

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();
14279

14380
```
14481

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**
14783

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);
15189

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);
15592

93+
// Remove all observers
94+
$issue->removeAllObservers();
15695

15796
```
15897

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+
163100
```php
101+
phpCopy code
102+
use Illuminate\Support\Carbon;
164103

165-
namespace App\Models\ExampleModel;
104+
// Set a due date for the issue
105+
$issue->setDueDate(Carbon::today());
166106

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();
177109

178110
```
179111

112+
## **Advanced Usage**
180113

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.
182115

183-
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
116+
## **Contributing**
184117

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.
186119

187-
Please see [CONTRIBUTING](README-contr.md) for details.
120+
## **License**
188121

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).
190123

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+
---
200125

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

Comments
 (0)