chaplean/kanbanize-client-bundle
Install via Composer:
composer require vendor/package-name
Publish the config (if applicable) and register the service provider in config/app.php. The core functionality revolves around task creation via the postCreateTask method, now enhanced with optional workflow parameters (workflow, workflowid, workflowname).
First Use Case: Trigger a task with workflow context:
use Vendor\Package\Facades\TaskManager;
TaskManager::postCreateTask(
$request->all(), // Base request data
workflow: 'approval', // Optional: Specify workflow
workflowid: 123, // Optional: Workflow ID
workflowname: 'Document Approval' // Optional: Workflow name
);
Leverage the new optional parameters to tie tasks to workflows:
// In a controller or service
public function handleRequest(Request $request) {
$taskData = $request->validate([
'title' => 'required',
'description' => 'nullable',
]);
TaskManager::postCreateTask(
$taskData,
workflow: $request->workflow, // Dynamic workflow selection
workflowid: $request->workflow_id
);
}
Use the workflowname parameter for human-readable logging:
TaskManager::postCreateTask(
$data,
workflowname: 'Customer Onboarding' // For audit trails
);
$workflow = auth()->user()->hasRole('admin') ? 'admin_override' : 'default';
TaskManager::postCreateTask($data, workflow: $workflow);
workflowid and workflowname are provided, the package prioritizes workflowid for internal processing but retains workflowname for logging.workflowname for UI/UX clarity and workflowid for backend consistency.postCreateTask without workflow parameters remain unchanged.TaskManager::postCreateTask($data, workflow: 'value'); // Preferred
TaskManager::postCreateTask(array_merge($data, ['workflow' => 'value'])); // Legacy
if (empty($request->workflow) && empty($request->workflow_id)) {
logger()->warning('Task created without workflow context');
}
WorkflowResolver to the package’s container.TaskManager::extend(function ($task) {
if ($task->workflow) {
$task->setMetadata('workflow_context', $task->workflow);
}
});
How can I help you explore Laravel packages today?