Install the CRM Application:
composer create-project orocrm/crm-application my_crm_project
cd my_crm_project
This provides a pre-configured Laravel/Symfony-based environment with OroCRM integrated.
Configure Database & Environment:
Update .env with your database credentials and run:
php bin/console oro:crm:install
This sets up the database schema, fixtures, and initial configurations.
First Use Case: Create a Lead Use the CLI to generate a lead entity (if not already included):
php bin/console oro:generate:entity --entity=Lead
Then interact via the admin UI at /admin or programmatically:
$lead = new \Oro\CRM\Bundle\LeadBundle\Entity\Lead();
$lead->setFirstName('John');
$lead->setLastName('Doe');
$lead->setEmail('john@example.com');
$em->persist($lead);
$em->flush();
/admin for pre-built dashboards, lists, and forms.src/Oro/CRM/Bundle/*/Entity/ for core entities (e.g., Lead, Account, Contact).src/Oro/CRM/Bundle/*/Services/ for business logic (e.g., lead conversion, email tracking).Entity Management:
EntityManager wrappers.
$account = $this->entityManager->find('OroCRMAccountBundle:Account', 1);
$account->addContact($contact); // Business logic via entity methods
$this->entityManager->flush();
# config/oro/entity_config.yml
Oro\CRM\Bundle\AccountBundle\Entity\Account:
fields:
custom_field:
type: text
form:
type: text
Business Processes:
LeadConverter service to automate workflows:
$converter = $this->container->get('oro_crm.lead.converter');
$account = $converter->convertLeadToAccount($lead);
Email bundle to track customer interactions:
$email = new \Oro\Bundle\EmailBundle\Entity\Email();
$email->setFrom('sales@example.com');
$email->setTo('customer@example.com');
$email->setSubject('Follow-up');
$this->emailManager->save($email);
APIs & Extensions:
oro_rest bundle and expose CRM entities:
# config/oro/api.yml
Oro\CRM\Bundle\LeadBundle\Entity\Lead:
operations:
- GET
- POST
HttpClient or Oro’s event system to trigger actions (e.g., Slack notifications on lead creation).laravel/symfony-bridge. Use Laravel’s service container to bind Oro services:
$this->app->bind('oro_crm.lead.manager', function ($app) {
return $app->make('oro_crm.lead.manager.default');
});
oro_crm.lead.create) to extend functionality:
$dispatcher->addListener('oro_crm.lead.create', function ($event) {
// Send welcome email
});
DataFixtures for initial data or custom migrations:
php bin/console oro:data-fixtures:load
Deprecated OroPlatform:
composer.json or use a Docker container with matching PHP/Symfony versions.Entity Inheritance:
AccountAddress). Overriding these requires careful handling of discriminator columns.oro:generate:entity to scaffold extensions safely.Caching Quirks:
php bin/console cache:clear
php bin/console oro:cache:clear --all
UI Customization:
vendor/orocrm/ to app/Resources/OroCRMBundle/ and extending them.oro:theme:dump to regenerate assets after changes.Symfony Profiler:
APP_DEBUG=true) to inspect Doctrine queries, events, and service calls.Logging:
config/packages/monolog.yaml:
handlers:
oro_crm:
type: stream
path: "%kernel.logs_dir%/oro_crm.log"
level: debug
Database Schema:
oro:database:dump-schema to inspect the current schema:
php bin/console oro:database:dump-schema --entity="OroCRMAccountBundle:Account" > schema.sql
Custom Entities:
Account) by creating a child class and updating the mapping:
# config/oro/entity_extensions.yml
Oro\CRM\Bundle\AccountBundle\Entity\Account:
extensions:
custom:
class: App\Entity\Extension\Account\CustomFields
Workflow Customization:
php bin/console oro:workflow:generate:transition --entity=Lead --transition=qualify
API Extensions:
ApiConfigProvider:
public function getConfig()
{
return [
'Oro\CRM\Bundle\LeadBundle\Entity\Lead' => [
'operations' => ['GET', 'POST', 'CUSTOM_ACTION'],
],
];
}
oro:generate:entity, oro:generate:form). Always check php bin/console list oro for available commands.Datagrid configuration:
# config/oro/datagrid.yml
Oro\CRM\Bundle\LeadBundle\Entity\Lead:
actions:
view:
type: navigate
route: oro_crm_lead_view
acl_resource: oro_crm_lead_view
php bin/console oro:data-fixtures:load --append --env=test
How can I help you explore Laravel packages today?