Blog Detail

26

Sep
AIssue - Basic & Lean Issue Management Package for Laravel cover image

arrow_back AIssue - Basic & Lean Issue Management Package for Laravel

AIssue is a Basic and Lean Issue Management Package for Laravel. It has the following features.

  • Basic Workflow and Issue Management
  • Limitless Issue Types
  • Limitless Statuses for Issue Types
  • Authenticatable Issue Status Transitions
  • Easy to Use and Lean

Installation & Setup

You can install the package via composer:

composer require aurorawebsoftware/aissue

You must add AIssueModelTrait Trait to the Issueable Model and The model must implement AIssueModelContract

use AuroraWebSoftware\AIssue\Contracts\AIssueModelContract;
use AuroraWebSoftware\AIssue\Traits\AIssueModelTrait;

class Issueable extends Model implements AIssueModelContract
{
    use AIssueModelTrait;

    // ...
}

You can publish and run the migrations with:

php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="aissue-config"

This is the example contents of the published config file:

    return [
        'policyMethod' => fn ($permission): bool => true,
        'issueTypes' => [
            'task' => [
                'todo' => ['sort' => 1, 'permission' => 'todo_perm'],
                'in_progress' => ['sort' => 2, 'permission' => 'in_progress_perm'],
                'done' => ['sort' => 3, 'permission' => 'done_perm'],
            ],
        ],
    ];

Permission Config File

Permissions are stored config/aissue.php is published after installing.

Usage

Before using this, please make sure that you published the config files.

AIssue Services, Service Provider, and Facade

Terminology

policyMethod : It is the definition that provides authorization check before reaching the Issuable.

IssueType : IssueType is Workflow type’s name determined by system authority.

transition : transition is changing of type example(todo,in_progres,done,etc).

status : status is IssueModel’s current type type example(todo,in_progres,done,etc).

Issueable : Issueable is an model that contains makeTransition,canMakeTransition,getTransitionableStatuses functions and workflow information.

Creating an Issuable

$createdModel = Issueable::create(
        ['name' => 'example isuable model']
    );

Using AIssue Interface and Trait with Eloquent Models

To turn an Eloquent Model into an AIssue ; Model must implement AIssueModelContract and use AIssueModelTrait Trait. After adding AIssueModelContract trait, you will be able to use AIssue methods within the model

namespace App\Models\ExampleModel;

    use AuroraWebSoftware\AIssue\Contracts\AIssueModelContract;
    use AuroraWebSoftware\AIssue\Traits\AIssueModelTrait;
    use Illuminate\Database\Eloquent\Model;
    
    class ExampleModel extends Model implements AIssueModelContract
    {
        use AIssueModelTrait;
    
        // implementation
}

For more details, Please visit Github.

Closing Note

The team of Codebrisk Laravel developers is always ready to execute even your boldest ideas. Our expert team can design and develop any type of custom CRM solution, SAAS app, or e-commerce app to meet our customer’s needs and transform our customer’s experiences. Get in touch with our team to discuss your bespoke ideas and learn more about the next steps to launching cooperation.

Published at : 26-09-2022

Author : Rizwan Aslam
AUTHOR
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

Launch your project

Launch project