Installation
composer require developtech/agility-bundle
Add to config/bundles.php:
return [
// ...
DevelopTech\AgilityBundle\DevelopTechAgilityBundle::class => ['all' => true],
];
Database Migrations Run migrations to create tables for projects, sprints, user stories, tasks, and feedbacks:
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
First Use Case Create a project via CLI:
php bin/console agility:project:create --name="My Agile Project" --description="Project description"
Access the admin dashboard at /agility/admin (ensure routing is configured).
Resources/doc/ for bundle-specific docs (if available).src/Controller/ for CRUD operations (e.g., ProjectController, SprintController).src/Entity/ for models like Project, UserStory, Task, etc.Resources/views/ for UI components (e.g., sprint boards, backlogs).DataFixtures/ for sample data (if provided).Project Management
ProjectManager service or CLI commands to scaffold projects.
$project = $this->get('agility.project_manager')->create(
'Project Name',
'Description',
['team_member1@example.com', 'team_member2@example.com']
);
Team entity to group users under projects.Sprint Planning
$sprint = $this->get('agility.sprint_manager')->create(
$project,
'Sprint 1',
new \DateTime('2023-10-01'),
new \DateTime('2023-10-15')
);
Task Tracking
$task = $this->get('agility.task_manager')->create(
$userStory,
'Implement login API',
'High'
);
Task entity’s status field (e.g., TODO, IN_PROGRESS, DONE).
$task->setStatus('IN_PROGRESS')->save();
Feedback Loops
$feedback = $this->get('agility.feedback_manager')->create(
$task,
'Client feedback: Add CSRF protection',
'High'
);
Custom Fields
Extend entities with custom fields (e.g., Task):
// src/Entity/Task.php
/**
* @ORM\Column(type="string", nullable=true)
*/
private $customField;
Update migrations and forms accordingly.
Event Listeners Hook into lifecycle events (e.g., sprint start/end):
// src/EventListener/SprintListener.php
class SprintListener implements EventSubscriberInterface {
public static function getSubscribedEvents() {
return [
SprintEvents::SPRINT_START => 'onSprintStart',
];
}
public function onSprintStart(SprintEvent $event) {
// Send notifications, etc.
}
}
API Endpoints Use Symfony’s serializers to expose data:
# config/routes.yaml
agility_api:
resource: "@DevelopTechAgilityBundle/Resources/config/routing/api.yaml"
prefix: /api/agility
Customize serializers in src/Serializer/ if needed.
Authentication Secure routes with Symfony’s security component:
# config/packages/security.yaml
access_control:
- { path: ^/agility, roles: ROLE_AGILITY_USER }
Database Schema
doctrine:migrations:diff and migrate after modifying entities.make:migration for complex changes.Permissions
// src/Voter/ProjectVoter.php
class ProjectVoter extends Voter {
protected function supports(string $attribute, $subject) {
return $attribute === 'EDIT' && $subject instanceof Project;
}
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token) {
// Custom logic here
}
}
Performance
task.status).$tasks = $entityManager->createQueryBuilder()
->select('t')
->from(Task::class, 't')
->where('t.sprint = :sprint')
->andWhere('t.status = :status')
->setParameter('sprint', $sprint)
->setParameter('status', 'TODO')
->getQuery()
->getResult();
UI Quirks
php bin/console cache:clear
{{ dump() }} in Twig to debug variables.Log Entities
Enable Doctrine logging in config/packages/dev/doctrine.yaml:
doctrine:
dbal:
logging: true
profiling: true
Event Debugging Dump events in listeners:
public function onSprintStart(SprintEvent $event) {
\Log::debug('Sprint started:', ['sprint' => $event->getSprint()->getName()]);
}
CLI Commands List available commands:
php bin/console list agility
Debug command arguments:
php bin/console agility:sprint:create --help
Custom Entities
Extend existing entities (e.g., Task) by overriding them in your app:
// src/Entity/Task.php
namespace App\Entity;
use DevelopTech\AgilityBundle\Entity\Task as BaseTask;
class Task extends BaseTask {
// Add custom methods/fields
}
Update config/packages/doctrine.yaml to map the new entity:
orm:
entity_managers:
default:
mappings:
App:
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
Custom Services
Override bundle services in config/services.yaml:
services:
DevelopTech\AgilityBundle\Manager\TaskManager:
class: App\Service\CustomTaskManager
arguments: ['@service_container']
Twig Extensions Add custom filters/functions:
// src/Twig/AppExtension.php
class AppExtension extends \Twig\Extension\AbstractExtension {
public function getFilters() {
return [
new \Twig\TwigFilter('custom_task_status', [$this, 'formatTaskStatus']),
];
}
public function formatTaskStatus($status) {
return str_replace('_', ' ', ucwords($status));
}
}
Register in config/packages/twig.yaml:
twig:
globals:
app_extension: '@app.twig_extension'
API Extensions Extend the API with custom controllers:
// src/Controller/Agility/CustomTaskController.php
class CustomTaskController extends AbstractController {
#[Route('/api/agility/tasks/custom', name: 'agility_custom_task', methods: ['GET'])]
public function customTaskList(TaskManager $taskManager) {
return $this->json($taskManager->getCustomTasks());
}
}
How can I help you explore Laravel packages today?