Welcome to MediansCRM
The most comprehensive Laravel-based CRM solution for modern businesses
Lightning Fast
Built with Laravel 11 and optimized for performance with advanced caching strategies.
Fully Responsive
Perfect experience across all devices - desktop, tablet, and mobile.
Enterprise Security
Advanced security features with role-based permissions and data encryption.
Highly Customizable
Extensive customization options with modular architecture and theme support.
What's Included
Complete source code, comprehensive documentation, free updates, premium support, and installation service.
System Requirements
Ensure your server meets these requirements for optimal performance
PHP Requirements
- PHP Version: 8.2 or higher
- Memory Limit: 256MB minimum (512MB recommended)
- Max Execution Time: 300 seconds
- Extensions: OpenSSL, PDO, Mbstring, Tokenizer, XML, Ctype, JSON, BCMath, Fileinfo, GD
Database Requirements
- MySQL: 5.7 or higher
- MariaDB: 10.3 or higher
- PostgreSQL: 9.6 or higher
- SQLite: 3.8 or higher
Server Requirements
- Web Server: Apache 2.4+ or Nginx 1.15+
- SSL Certificate: Recommended for production
- URL Rewriting: mod_rewrite (Apache) or equivalent
- Storage: 1GB minimum free space
# Check PHP version
php -v
# Check required extensions
php -m | grep -E "(openssl|pdo|mbstring|tokenizer|xml|ctype|json|bcmath|fileinfo|gd)"
# Check MySQL version
mysql --version
Installation Guide
Step-by-step installation process for MediansCRM
Download & Extract
Download MediansCRM from CodeCanyon and extract the files to your web server directory.
# Extract the downloaded file
unzip medians-crm-v2.0.zip
cd medians-crm
Set Permissions
Set proper file permissions for Laravel directories.
# Set permissions
chmod -R 777 storage public bootstrap/cache
chmod -R 777 app/Modules app/Modules/modules.json #used for Modules Management
#If you user is www-data
chown -R www-data:www-data storage public bootstrap/cache
Access Setup Wizard
Navigate to your domain and follow the automatic setup wizard.
Visit https://yourdomain.com/setup to start the installation wizard.
Install Dependencies
# Install Composer dependencies
composer install --optimize-autoloader --no-dev
# Install NPM dependencies
npm install
npm run build
Environment Configuration
# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generate
Database Setup
Configure your database settings in the .env
file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=medianscrm
DB_USERNAME=your_username
DB_PASSWORD=your_password
Run Migrations
# Run database migrations
php artisan migrate
# Seed initial data
php artisan db:seed
Docker Compose Setup
# docker-compose.yml
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- .:/var/www/html
environment:
- DB_HOST=database
- DB_DATABASE=medianscrm
- DB_USERNAME=root
- DB_PASSWORD=secret
depends_on:
- database
database:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: medianscrm
volumes:
- mysql_data:/var/lib/mysql
volumes:
mysql_data:
Launch with Docker
# Start the containers
docker-compose up -d
# Access the application
# Visit http://localhost:8000/setup
Setup Wizard Guide
Complete walkthrough of the MediansCRM installation wizard
Welcome & System Check

What happens in this step:
- Welcome message and feature overview
- Automatic system requirements check
- PHP version and extensions validation
- Directory permissions verification
- Server configuration assessment
Important: All requirements must pass before proceeding to the next step.
Database Configuration

Database setup process:
- Choose database type (MySQL, PostgreSQL, SQLite)
- Enter database connection details
- Test database connection
- Automatic database creation (if needed)
- Connection validation and optimization
Example Configuration:
Administrator Account

Admin account creation:
- Administrator personal information
- Secure password setup with strength meter
- Company details and branding
- Time zone and locale settings
- Contact information and preferences
Security: Passwords must be at least 8 characters with mixed case, numbers, and special characters.
Module Selection

Choose your modules:
Core Modules (Required)
- Customer Management
- Lead Management
- Deal Pipeline
- Project Management
- ...
Optional Modules
- WhatsApp Integration
- Marketing Campaigns
- Advanced Analytics
- Workflow Automation
- ...
Installation Process

Automated installation:
- Environment file generation
- Database table creation
- Initial data seeding
- Module activation and configuration
- Cache optimization and cleanup
Installation Complete!
Installation Complete!
After successful installation, you'll be redirected to the login page where you can access your new MediansCRM system with the administrator account you created.
Lead Management
Complete lead management system with advanced generation, assignment, and tracking capabilities
Comprehensive Lead Management
MediansCRM's lead management module provides everything you need to capture, qualify, assign, and convert leads into customers with advanced automation and reporting features.

Core Features
Lead Capture
- Manual lead creation with custom fields
- CSV/Excel import functionality
- Web form integration
- Multiple lead sources tracking
- Automated lead validation
Lead Generation
- Google Search API integration
- Brave Search API integration
- Apollo.io API integration
- Foursquare Places API
- NLP text extraction
Assignment & Distribution
- Manual lead assignment
- Automatic distribution rules
- Team capacity tracking
- Round-robin assignment
- Assignment analytics
Tracking & Reports
- Lead status management
- Conversion tracking
- Performance reports
- Lead source analytics
- Team performance metrics
Lead Creation & Import
Manual Lead Creation
Create leads directly through the web interface with all necessary information and custom fields.
Lead Information Fields
- First Name & Last Name
- Contacts & Location
- Company & Position
- Lead Source
- Assigned Staff Member
- Lead Status
- Priority Level
- Info about the Lead
CSV Import
Import multiple leads from CSV or Excel files with field mapping and validation.
Upload File
Upload your CSV file with lead data
Map Fields
Map CSV columns to CRM fields
Validate & Import
Review and import leads
API Lead Creation
curl -X POST "https://yourcrm.com/api/v1/leads" \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"company": "Acme Corp",
"position": "Marketing Manager",
"source_id": 1,
"assigned_to": 5,
"status_id": 1
}'
Lead Generation APIs
MediansCRM integrates with multiple lead generation services to help you find potential customers automatically.
Google Search API
Search for businesses and contacts using Google's comprehensive database
Brave Search API
Privacy-focused search engine for finding business contacts and information
Apollo.io Integration
Professional contact database with verified business emails and phone numbers
Foursquare Places
Location-based business discovery with detailed venue information
Lead Generation Workflow
Search
Define search criteria and target audience
Filter
Apply filters and validation rules
Import
Import qualified leads into CRM
Assign
Automatically assign to team members
Lead Assignment & Distribution
Manual Assignment
Manually assign leads to specific team members based on expertise or availability
- Individual lead assignment
- Bulk assignment operations
- Assignment history tracking
Round-Robin Assignment
Automatically distribute leads evenly among team members
- Equal distribution algorithm
- Capacity-based assignment
- Skip unavailable members
Smart Assignment
AI-powered assignment based on performance and expertise
- Performance-based routing
- Skill matching
- Workload balancing
Assignment Analytics
Team Capacity
Distribution Balance
Avg Response Time
Lead Reports & Analytics
Performance Reports
Sales Pipeline
Activity Reports
Lead Dashboard
Integration Examples
// Create a new lead
$lead = new Lead([
'first_name' => 'Jane',
'last_name' => 'Smith',
'email' => 'jane.smith@company.com',
'phone' => '+1987654321',
'company' => 'Tech Solutions Inc',
'position' => 'CTO',
'source_id' => 2, // Web form
'status_id' => 1, // New lead
'assigned_to' => 3, // Auto-assigned
'business_id' => auth()->user()->business_id
]);
$lead->save();
// Trigger assignment notification
event(new LeadEventCreated($lead));
// Assign multiple leads using round-robin
$leadIds = [1, 2, 3, 4, 5];
$teamMembers = [10, 11, 12]; // Staff IDs
$assignmentHelper = new LeadAssignmentHelper();
$result = $assignmentHelper->assignLeadsRoundRobin($leadIds, $teamMembers);
// Update lead assignments
foreach ($result as $leadId => $staffId) {
Lead::where('lead_id', $leadId)
->update(['assigned_to' => $staffId]);
}
// Update lead status and log activity
$lead = Lead::find(1);
$lead->update([
'status_id' => 3, // Qualified
]);
// Log status change activity
$lead->logActivity('status_updated', [
'old_status' => 'New',
'new_status' => 'Qualified',
'updated_by' => auth()->user()->id
]);
Deals & Pipelines Management
Complete sales pipeline management with customizable stages, deal tracking, and conversion analytics
Advanced Sales Pipeline Management
MediansCRM's deals and pipelines module provides a comprehensive solution for managing your sales process from lead qualification to deal closure with customizable pipelines and advanced analytics.

Core Features
Deal Management
- Create and track sales opportunities
- Deal value and probability tracking
- Expected close date management
- Multi-currency support
- Deal assignment and ownership
Custom Pipelines
- Create unlimited sales pipelines
- Customizable pipeline stages
- Drag-and-drop stage management
- Stage-specific automation
- Pipeline templates
Lead Conversion
- Convert qualified leads to deals
- Automatic data transfer
- Lead-to-deal mapping
- Conversion tracking
- Source attribution
Sales Analytics
- Pipeline performance metrics
- Win rate analysis
- Sales forecasting
- Team performance tracking
- Revenue reports
Deal Creation & Management
Manual Deal Creation
Create deals directly through the web interface with complete deal information and pipeline assignment.
Deal Information Fields
- Deal Name & Code
- Deal Amount & Currency
- Probability & Expected Close Date
- Description & Notes
- Related Model ( Project/Client )
- Pipeline & Stage
- Deal Client
- Team Members
Lead Conversion
Convert qualified leads into deals with automatic data transfer and pipeline placement.
Select Lead
Choose qualified lead to convert
Deal Details
Add deal value and timeline
Pipeline Assignment
Assign to appropriate pipeline
API Deal Creation
curl -X POST "https://yourcrm.com/api/v1/deals" \
-H "Content-Type: application/json" \
-d '{
"name": "Website Redesign Project",
"amount": 15000,
"currency_code": "USD",
"probability": 75,
"expected_due_date": "2025-09-15",
"client_id": 123,
"pipeline_id": 1,
"stage_id": 2,
"description": "Complete website redesign project"
}'
Pipeline Management
Create and customize sales pipelines to match your unique sales process and business requirements.
Pipeline Creation
Create multiple pipelines for different products, services, or sales processes
Stage Management
Define custom stages with specific criteria and automation rules
Stage Transitions
Control how deals move between stages with validation and automation
Example Sales Pipeline
1. Prospecting
12 deals2. Qualification
8 deals3. Proposal
5 deals4. Negotiation
3 deals5. Closed Won
2 dealsDeal Tracking & Progress
Value Tracking
Monitor deal values, probability changes, and revenue forecasting
- Deal amount history
- Probability adjustments
- Weighted pipeline value
- Currency conversion
Timeline Management
Track important dates and milestones throughout the sales process
- Expected close dates
- Stage entry dates
- Activity timelines
- Follow-up reminders
Activity Tracking
Monitor all deal-related activities and communications
- Meeting history
- Email communications
- Call logs
- Document sharing
Deal Status Management
Sales Reports & Analytics
Pipeline Reports
Performance Reports
Period Reports
Sales Dashboard
Active Deals
Pipeline Value
Win Rate
Avg. Cycle Time
Integration Examples
// Create a new deal
$deal = new Deal([
'name' => 'Enterprise Software License',
'amount' => 50000,
'currency_code' => 'USD',
'probability' => 60,
'expected_due_date' => '2025-10-30',
'client_id' => 15,
'status' => 'active',
'business_id' => auth()->user()->business_id,
'created_by' => auth()->user()->id
]);
$deal->save();
// Assign to pipeline and stage
$deal->assignToPipeline(2, 1); // Pipeline ID 2, Stage ID 1
// Trigger deal creation event
event(new DealCreated($deal));
// Convert lead to deal
$lead = Lead::find(25);
$deal = Deal::create([
'name' => $lead->company . ' - ' . $lead->position,
'amount' => 25000,
'currency_code' => 'USD',
'probability' => 50,
'expected_due_date' => now()->addDays(45),
'lead_id' => $lead->lead_id,
'status' => 'active',
'business_id' => $lead->business_id,
'created_by' => auth()->user()->id
]);
// Update lead status
$lead->update(['status_id' => 4]); // Converted status
// Log conversion activity
$deal->logActivity('converted_from_lead', [
'lead_id' => $lead->lead_id,
'converted_by' => auth()->user()->id
]);
// Update deal stage and probability
$deal = Deal::find(10);
$oldStage = $deal->current_stage;
$newStage = 3; // Proposal stage
$deal->update([
'probability' => 75, // Increase probability
'amount' => 45000 // Update deal value
]);
// Move to next stage
$deal->moveToStage($newStage);
// Log stage change
$deal->logActivity('stage_updated', [
'old_stage' => $oldStage,
'new_stage' => $newStage,
'updated_by' => auth()->user()->id
]);
// Trigger stage update event
event(new DealUpdated($deal));
// Create new sales pipeline
$pipeline = Pipeline::create([
'name' => 'SaaS Sales Process',
'model' => 'Deal',
'description' => 'Pipeline for SaaS product sales',
'business_id' => auth()->user()->business_id,
'created_by' => auth()->user()->id
]);
// Create pipeline stages
$stages = [
['name' => 'Demo Scheduled', 'sort' => 1],
['name' => 'Needs Analysis', 'sort' => 2],
['name' => 'Proposal Sent', 'sort' => 3],
['name' => 'Contract Review', 'sort' => 4],
['name' => 'Closed Won', 'sort' => 5]
];
foreach ($stages as $stageData) {
$pipeline->stages()->create($stageData);
}
Customer Management
Comprehensive customer relationship management with advanced features
Complete Customer Lifecycle Management
MediansCRM's customer management module provides everything you need to track, manage, and nurture your customer relationships from first contact to long-term loyalty.

Key Features
Customer Profiles
- Complete contact information management
- Custom fields for industry-specific data
- Social media integration
- Document and file attachments
- Relationship mapping
Communication Tracking
- Email integration and tracking
- Call logs and recordings
- Meeting notes and follow-ups
- WhatsApp conversation history
- Social media interactions
Segmentation & Targeting
- Dynamic customer segments
- Behavioral targeting
- Purchase history analysis
- Lifecycle stage tracking
- Custom tag management
Analytics & Insights
- Customer lifetime value
- Engagement metrics
- Satisfaction scores
- Revenue attribution
- Churn prediction
API Integration Example
// Create a new customer
$customer = new Customer([
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+1234567890',
'company' => 'Acme Corp',
'status' => 'active',
'source' => 'website',
'custom_fields' => [
'industry' => 'Technology',
'company_size' => '50-100'
]
]);
$customer->save();
// Add to segment
$customer->addToSegment('high-value-prospects');
// Log activity
$customer->logActivity('customer_created', [
'source' => 'api',
'created_by' => auth()->user()->id
]);
Projects Module
Comprehensive project management and collaboration system
Complete Project Lifecycle Management
MediansCRM's Projects module provides powerful project management capabilities to plan, track, and deliver projects efficiently with team collaboration and client transparency.

Core Features
Project Creation & Setup
- Project name and description
- Client assignment
- Start and deadline dates
- Budget and cost tracking
- Status management
- Custom fields support
Team Collaboration
- Team member assignment
- Role-based permissions
- Activity tracking
- File sharing
- Comments and notes
Progress Tracking
- Task completion tracking
- Progress percentage
- Timeline visualization
- Milestone management
- Status reporting
Integration Features
- Task integration
- Time tracking
- Meeting scheduling
- File attachments
- Client portal access
Project Workflow
1. Create Project
Set up project details, assign client, define scope and timeline.
2. Add Tasks
Break down project into manageable tasks and assign team members.
3. Execute & Track
Monitor progress, log time, update status, and collaborate with team.
4. Complete & Review
Finalize deliverables, review outcomes, and close project.
API Integration Examples
Create New Project
// Create a new project
$project = Project::create([
'name' => 'Website Redesign',
'description' => 'Complete website redesign project',
'client_id' => 123,
'start_date' => '2025-08-15',
'deadline_date' => '2025-10-15',
'total_cost' => 15000,
'is_paid' => false,
'status_id' => 1,
'business_id' => auth()->user()->business_id
]);
// Add custom fields
$project->fields()->create([
'code' => 'project_type',
'value' => 'Web Development'
]);
return response()->json($project->load('client', 'status'));
Update Project Status
// Update project details
$project = Project::findOrFail($id);
$project->update([
'name' => $request->name,
'description' => $request->description,
'deadline_date' => $request->deadline_date,
'status_id' => $request->status_id
]);
// Log activity
$project->activities()->create([
'action' => 'updated',
'description' => 'Project details updated',
'user_id' => auth()->id()
]);
return response()->json($project->fresh());
Query Projects with Filters
// Query projects with filters
$projects = Project::query()
->with(['client', 'status', 'tasks'])
->when($request->status_id, function($q, $status) {
return $q->where('status_id', $status);
})
->when($request->client_id, function($q, $client) {
return $q->where('client_id', $client);
})
->when($request->search, function($q, $search) {
return $q->where('name', 'like', "%{$search}%");
})
->forBusiness(auth()->user()->business_id)
->paginate(15);
return response()->json($projects);
Advanced Features
Time Tracking & Timesheets
Time Logging
Track time spent on projects and tasks with start/stop functionality
Timesheet Management
Generate detailed timesheets for billing and reporting
Cost Calculation
Automatic cost calculation based on hourly rates
File & Document Management
File Uploads
Attach documents, images, and files to projects
Organization
Organize files by project and task for easy access
Sharing
Share files with team members and clients securely
Project Reports & Analytics
Progress Reports
Track project completion and milestones
Time Reports
Analyze time spent across projects and tasks
Cost Analysis
Review project costs and budget utilization
Team Performance
Evaluate team productivity and workload
Project Settings & Configuration
Status Management
Configure project status options (Active, On Hold, Completed, Cancelled)
Custom Fields
Add custom fields to capture project-specific information
Permissions
Control access levels for different user roles
Available Routes
Finance Module
Complete financial management solution for invoicing, payments, expenses, and financial reporting
Comprehensive Financial Management
MediansCRM's Finance module provides a complete financial ecosystem to manage invoices, credit notes, transactions, items, and expenses. Track your business finances with detailed reporting and automated workflows.

Finance Module Components
Invoices
Create, send, and manage professional invoices with automated payment tracking and client communication.
- Professional invoice templates
- Automated invoice numbering
- Payment status tracking
- Email delivery system
- Multi-currency support
- Tax calculations
Credit Notes
Issue credit notes for returns, refunds, and adjustments with full invoice integration and tracking.
- Link to original invoices
- Automated calculations
- Approval workflows
- Client notifications
- Status management
- Reporting integration
Transactions
Track all financial transactions with detailed payment records and automated transaction matching.
- Payment method tracking
- Transaction categorization
- Automated reconciliation
- Payment confirmations
- Transaction history
- Financial reporting
Items & Inventory
Manage your products and services catalog with pricing, categories, and inventory tracking.
- Product/service catalog
- Dynamic pricing
- Item categorization
- Tax rate management
- Bulk operations
- Usage analytics
Expenses
Track business expenses with categorization, receipt management, and detailed expense reporting.
- Expense categorization
- Receipt attachments
- Project allocation
- Approval workflows
- Expense reports
- Tax compliance
Financial Workflow
1. Setup Items & Services
Create your product/service catalog with pricing, taxes, and categories for consistent invoicing.
2. Create & Send Invoices
Generate professional invoices from your items catalog, send to clients via email with automated tracking.
3. Track Payments
Record payments, create transactions, and automatically update invoice status with payment confirmations.
4. Handle Returns/Adjustments
Issue credit notes for refunds, returns, or invoice adjustments with full audit trails.
5. Track Expenses
Record business expenses with proper categorization and project allocation for accurate profitability.
6. Financial Reporting
Generate comprehensive financial reports for business analysis and tax compliance.
Advanced Finance Features
Professional Invoicing System
Automated Invoice Generation
Create invoices from projects, estimates, or recurring schedules with automated numbering and calculations.
Email Delivery System
Send professional invoices directly to clients with customizable email templates and delivery tracking.
Multi-Currency Support
Handle international clients with multi-currency invoicing and automatic currency conversion.
Advanced Tax Calculations
Automatic tax calculations with support for multiple tax rates, tax-inclusive/exclusive pricing.
Invoice Creation Example
// Create invoice from project
$invoice = $invoiceService->createInvoice([
'model_id' => $project->id,
'model_type' => Project::class,
'client_id' => $project->client_id,
'date' => now()->format('Y-m-d'),
'due_date' => now()->addDays(30)->format('Y-m-d'),
'description' => 'Web Development Services',
'total' => 5000.00,
'subtotal' => 4545.45,
'tax_amount' => 454.55,
'status_id' => 1 // Draft
], [
['item_id' => 1, 'quantity' => 40, 'price' => 100.00, 'total' => 4000.00],
['item_id' => 2, 'quantity' => 10, 'price' => 50.00, 'total' => 500.00]
]);
// Send invoice via email
$invoiceService->sendInvoice($invoice->id);
Payment & Transaction Management
Multiple Payment Methods
Support for various payment methods including bank transfers, credit cards, PayPal, and cash payments.
Automated Status Updates
Automatically update invoice status when payments are recorded and notify relevant parties.
Payment Security
Secure payment processing with transaction verification and audit trails for compliance.
Payment History
Complete payment history tracking with detailed transaction records and reconciliation tools.
Payment Status Flow
Items & Inventory Management
Product/Service Catalog
Comprehensive catalog management for products and services with detailed descriptions and pricing.
Category Management
Organize items into categories and groups for easy navigation and reporting.
Dynamic Pricing
Flexible pricing options with support for tiered pricing, discounts, and tax configurations.
Bulk Import/Export
Import items from CSV files or export catalog data for external processing and analysis.
Item Usage Analytics
Most Used Items
Total Revenue
Expense Tracking & Management
Expense Categories
Organize expenses into customizable categories for better tracking and tax reporting.
Project Allocation
Allocate expenses to specific projects for accurate profitability analysis and client billing.
Approval Workflows
Set up approval processes for expense submissions with role-based authorization levels.
Receipt Management
Attach digital receipts and documents to expense records for audit trails and compliance.
Common Expense Categories
Financial Reports & Analytics
Revenue Reports
Track income from invoices and payments with trend analysis and forecasting.
- Monthly/Quarterly revenue
- Client revenue breakdown
- Service/product performance
- Payment method analysis
Tax Reports
Comprehensive tax reporting for compliance with automated calculations and summaries.
- Tax liability summary
- Deductible expenses
- VAT/GST reporting
- Export for accounting software
Profit & Loss
Detailed P&L statements showing revenue, expenses, and profitability by period.
- Revenue vs expenses
- Gross and net profit
- Project profitability
- Year-over-year comparison
Cash Flow
Monitor cash flow with incoming and outgoing transaction analysis and projections.
- Cash flow forecast
- Outstanding invoices
- Payment trends
- Liquidity analysis
API Integration Examples
Invoice Management API
// Create invoice
$invoice = $invoiceService->createInvoice([
'model_id' => $project->id,
'model_type' => Project::class,
'client_id' => $client->id,
'date' => now()->format('Y-m-d'),
'due_date' => now()->addDays(30)->format('Y-m-d'),
'description' => 'Project Development Invoice',
'status_id' => 1 // Draft status
], $invoiceItems);
// Send invoice via email
$result = $invoiceService->sendInvoice($invoice->id);
// Mark invoice as paid
$payment = $invoiceService->markAsPaid($invoice->id, [
'amount' => $invoice->total,
'payment_method' => 'bank_transfer',
'transaction_id' => 'TXN123456',
'payment_date' => now()->format('Y-m-d')
]);
return response()->json([
'invoice' => $invoice->load('client', 'items', 'status'),
'payment' => $payment
]);
Payment Processing API
// Create payment transaction
$transaction = $transactionService->createTransaction([
'model_id' => $invoice->id,
'model_type' => Invoice::class,
'user_id' => $client->id,
'user_type' => Client::class,
'amount' => 5000.00,
'description' => 'Payment for Invoice #INV-001',
'payment_method' => 'credit_card',
'date' => now()->format('Y-m-d'),
'status_id' => 7, // Completed
'custom_field' => [
'transaction_id' => 'stripe_pi_1234567890',
'card_last_four' => '4242',
'receipt_url' => 'https://stripe.com/receipt/123'
]
]);
// Update invoice status automatically
$invoice->update(['status_id' => 8]); // Paid
return response()->json($transaction->load('model', 'user'));
Expense Management API
// Create business expense
$expense = $expenseService->createExpense([
'amount' => 250.00,
'description' => 'Office supplies for Q4',
'date' => now()->format('Y-m-d'),
'category_id' => 3, // Office Supplies category
'model_id' => $project->id, // Optional: allocate to project
'model_type' => Project::class,
'status_id' => 1, // Pending approval
'business_id' => auth()->user()->business_id,
'created_by' => auth()->id()
]);
// Attach receipt
$expense->uploads()->create([
'file_path' => $receiptPath,
'file_name' => 'receipt.pdf',
'file_type' => 'application/pdf'
]);
return response()->json($expense->load('category', 'model'));
Item Management API
// Create service item
$item = $itemService->createItem([
'name' => 'Web Development (Hourly)',
'description' => 'Professional web development services',
'price' => 100.00,
'tax' => 10.00, // 10% tax rate
'group_id' => 1, // Services group
'business_id' => auth()->user()->business_id,
'created_by' => auth()->id()
]);
// Bulk update prices
$priceUpdates = [
['item_id' => 1, 'price' => 110.00],
['item_id' => 2, 'price' => 55.00],
];
$results = $itemService->bulkUpdatePrices($priceUpdates);
// Import items from CSV
$importData = [
['name' => 'Consulting', 'price' => 150.00, 'tax' => 10.00],
['name' => 'Design', 'price' => 80.00, 'tax' => 10.00],
];
$imported = $itemService->importItems($importData);
return response()->json([
'item' => $item,
'bulk_update' => $results,
'imported' => $imported
]);
Available Routes
Invoice Routes
Payment & Transaction Routes
Items & Inventory Routes
Expense Routes
Credit Notes Routes
Business Settings & Configuration
Invoice Settings
Payment Settings
Item Settings
Expense Settings
Integration & Best Practices
Financial Workflow Optimization
Set up automated workflows for invoice creation, payment processing, and expense approvals to reduce manual work and improve accuracy.
Data Security & Compliance
Ensure all financial data is properly secured with encryption, access controls, and regular backups for compliance with financial regulations.
Financial Reporting
Use comprehensive reporting features to track business performance, generate tax reports, and make data-driven financial decisions.
System Integration
Integrate with external accounting software, payment gateways, and banking systems for seamless financial management.
Proposals & Estimates Modules
Professional proposal creation and accurate project estimation system
Complete Sales & Estimation Pipeline
MediansCRM's Proposals and Estimates modules provide comprehensive tools for creating professional proposals, generating accurate estimates, and managing client requests with seamless conversion to invoices.

Proposals Module
Create and manage professional business proposals with templates, approval workflows, and conversion tracking.
- Template-based proposal creation
- Client approval workflows
- Multi-currency support
- Automated assignment system
- Conversion to invoices
- Performance analytics
Estimates Module
Generate accurate project estimates with detailed breakdowns, client portal access, and automatic follow-up systems.
- Detailed cost breakdowns
- Estimate request management
- Client portal integration
- Automatic assignment
- Expiry date tracking
- Conversion tracking
Core Features
Document Creation
- Rich text content editor
- Item-based line items
- Tax and discount calculations
- Currency selection
- Template integration
- Custom fields support
Assignment & Workflow
- Automatic staff assignment
- Round-robin distribution
- Workload-based assignment
- Approval workflows
- Status tracking
- Notification system
Client Portal
- Client viewing access
- Online approval/rejection
- Estimate request creation
- Status updates
- Download capabilities
- Comment system
Business Settings
- Numbering systems
- Default currencies
- Capacity limits
- Retention policies
- Notification preferences
- Validation rules
Module Workflows
1. Create Proposal
Draft proposal with items, assign staff, set deadlines
2. Send to Client
Share via client portal or email notification
3. Client Review
Client reviews and approves/rejects proposal
4. Convert to Invoice
Generate invoice from approved proposal
1. Receive Request
Client submits estimate request through portal
2. Auto Assignment
System assigns to staff based on workload/rules
3. Create Estimate
Staff prepares detailed cost breakdown
4. Client Decision
Client accepts estimate and initiates project
API Integration Examples
Create Business Proposal
// Create a new proposal
$proposal = Proposal::create([
'title' => 'Website Development Proposal',
'content' => 'Comprehensive website development package',
'client_id' => 123,
'client_type' => Client::class,
'date' => now(),
'expiry_date' => now()->addDays(30),
'currency_code' => 'USD',
'subtotal' => 15000,
'tax_amount' => 1500,
'total' => 16500,
'business_id' => auth()->user()->business_id,
'created_by' => auth()->id()
]);
// Add proposal items
$proposal->items()->create([
'description' => 'Frontend Development',
'quantity' => 1,
'rate' => 8000,
'amount' => 8000
]);
return response()->json($proposal->load('items', 'client'));
Generate Project Estimate
// Create estimate from request
$estimate = Estimate::create([
'title' => 'Mobile App Development Estimate',
'client_id' => $request->client_id,
'date' => now(),
'expiry_date' => now()->addDays(15),
'currency_code' => 'USD',
'subtotal' => 25000,
'discount_amount' => 2500,
'tax_amount' => 2250,
'total' => 24750,
'estimate_number' => EstimateService::generateNumber(),
'business_id' => auth()->user()->business_id
]);
// Auto-assign based on business settings
EstimateAssignmentHelper::autoAssignEstimate($estimate);
// Send notification
EstimateNotificationHelper::notifyEstimateCreated($estimate);
return response()->json($estimate);
Convert to Invoice
// Convert proposal/estimate to invoice
$proposal = Proposal::findOrFail($id);
$invoice = Invoice::create([
'client_id' => $proposal->client_id,
'proposal_id' => $proposal->id,
'date' => now(),
'due_date' => now()->addDays(30),
'subtotal' => $proposal->subtotal,
'tax_amount' => $proposal->tax_amount,
'total' => $proposal->total,
'currency_code' => $proposal->currency_code,
'business_id' => $proposal->business_id
]);
// Copy items from proposal
foreach ($proposal->items as $item) {
$invoice->items()->create($item->toArray());
}
// Update proposal status
$proposal->update([
'converted_to_invoice' => true,
'invoice_id' => $invoice->id,
'converted_at' => now()
]);
return response()->json($invoice->load('items'));
Advanced Features
Automated Assignment System
Assignment Methods
Distribute proposals/estimates evenly among staff members
Assign based on current workload and capacity
Random assignment within qualified staff pool
Manual assignment by managers
Estimate Request Management
Client Portal Integration
Clients can submit estimate requests directly through the portal
Daily Limits
Configurable daily limits per client to prevent spam
Attachment Support
Clients can attach files with size and type restrictions
Auto-Response
Automated acknowledgment and response time tracking
Analytics & Performance Reports
Conversion Rate
Track proposal to invoice conversion rates
Response Time
Average time to respond to estimate requests
Value Analysis
Total value of proposals and estimates by period
Staff Performance
Individual staff conversion and response metrics
Status Distribution
Breakdown of proposals/estimates by status
Approval Time
Average time from submission to client approval
Business Configuration
Numbering & Format
- Auto-numbering system
- Custom number prefixes
- Number format templates
Financial Settings
- Default currencies
- Minimum/maximum amounts
- Tax calculation rules
Notifications
- Assignment notifications
- Status change alerts
- Expiry warnings
Validation & Limits
- Capacity management
- Retention policies
- Approval workflows
Available Routes
Proposals Routes
Estimates Routes
WhatsApp Business Integration
Seamless WhatsApp Business API integration for customer communication
Why WhatsApp Integration?
2+ Billion Users
Connect with customers on their preferred platform
Instant Communication
Real-time messaging with read receipts
Rich Media Support
Send documents, images, videos, and locations
End-to-End Encryption
Secure business communications
WhatsApp Business API Setup
1. WhatsApp Business Account
Create a WhatsApp Business Account and get approved for the WhatsApp Business API.
- Apply through a WhatsApp Business Solution Provider
- Complete business verification process
- Obtain your Business Account ID and Phone Number ID
2. API Credentials
Configure your WhatsApp Business API credentials in MediansCRM.
# WhatsApp Configuration
WHATSAPP_TOKEN=your_access_token
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_BUSINESS_ACCOUNT_ID=your_business_account_id
WHATSAPP_WEBHOOK_VERIFY_TOKEN=your_verify_token
3. MediansCRM Configuration
Navigate to Settings > WhatsApp Integration to complete the setup.
WhatsApp Features in MediansCRM
Unified Messaging Interface
Unified Inbox
All WhatsApp conversations in one place alongside email and other channels
Team Collaboration
Assign conversations to team members with internal notes
Rich Media
Send and receive images, documents, videos, and location data

Message Templates
Create and manage WhatsApp Business message templates for consistent communication.
Template Example: Order Confirmation
{
"name": "order_confirmation",
"language": "en",
"category": "TRANSACTIONAL",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order Confirmed ✅"
},
{
"type": "BODY",
"text": "Hello {{1}}, your order #{{2}} has been confirmed! Expected delivery: {{3}}. Track your order: {{4}}"
},
{
"type": "FOOTER",
"text": "Thank you for choosing us!"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Track Order",
"url": "https://yourstore.com/track/{{5}}"
}
]
}
]
}
WhatsApp Automation
Welcome Messages
Automatically send welcome messages to new WhatsApp contacts
Follow-up Reminders
Automated follow-up messages based on customer actions
Abandoned Cart Recovery
Send cart abandonment messages with personalized offers
Event-based Messages
Birthday wishes, anniversaries, and milestone celebrations
WhatsApp Analytics
Messages Sent
Message Read Rate
Response Rate
Avg Response Time
Campaign Management
Multi-channel marketing campaigns with advanced targeting, automation, and comprehensive analytics
Advanced Marketing Campaign System
MediansCRM's campaign module provides a comprehensive solution for creating, managing, and analyzing multi-channel marketing campaigns with email, WhatsApp, and mixed communication strategies.

Core Features
Multi-Channel Campaigns
- Email marketing campaigns
- WhatsApp Business messaging
- Mixed channel campaigns
- Template-based content creation
- Personalized message content
Smart Targeting
- Dynamic audience segmentation
- Criteria-based targeting
- Lead, deal, and client targeting
- Custom field filtering
- Real-time audience preview
Campaign Automation
- Scheduled campaign delivery
- Automated send triggers
- Drip campaign sequences
- Follow-up automation
- Response-based actions
Analytics & Tracking
- Delivery and open rates
- Click-through tracking
- Engagement analytics
- ROI measurement
- Performance comparison
Campaign Creation & Setup
Visual Campaign Builder
Create comprehensive campaigns using our intuitive builder with advanced targeting and content customization.
Campaign Settings
Define campaign name, type, and basic configuration
- Campaign name and description
- Channel selection (Email/WhatsApp/Mixed)
- Priority and scheduling options
Audience Targeting
Define your target audience with precise criteria
- Target model selection (Leads/Deals/Clients)
- Custom filtering criteria
- Real-time audience count preview
Content Creation
Design engaging content for your campaign
- Email template selection and customization
- WhatsApp message formatting
- Personalization variables
Review & Launch
Test and deploy your campaign
- Campaign preview and testing
- Delivery scheduling
- Performance tracking setup
Template-based Campaigns
Start with pre-designed campaign templates optimized for different business scenarios and objectives.
Lead Nurturing Templates
Welcome Series
Multi-step onboarding sequence
Re-engagement
Win back inactive prospects
Sales Campaigns
Deal Follow-up
Automated deal progression
Customer Success
Post-purchase engagement
API Campaign Creation
curl -X POST "https://yourcrm.com/api/v1/campaigns" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Product Launch Campaign",
"subject": "Introducing Our Latest Innovation",
"campaign_type": "email",
"target_model_type": "Lead",
"target_criteria": {
"status": "qualified",
"source": "website",
"created_after": "2025-01-01"
},
"email_content": "...",
"scheduled_at": "2025-08-15 10:00:00"
}'
Multi-Channel Campaign Types
Reach your audience through their preferred communication channels with targeted messaging strategies.
Email Campaigns
Professional email marketing with advanced features and tracking
WhatsApp Campaigns
Direct messaging through WhatsApp Business API for personal engagement
Mixed Campaigns
Coordinated multi-channel approach for maximum reach and engagement
Advanced Audience Targeting
Dynamic Segmentation
Create sophisticated audience segments using multiple criteria and filters
- Demographic filtering
- Behavioral segmentation
- Custom field criteria
- Activity-based targeting
Multi-Model Targeting
Target across different CRM entities with unified campaign management
- Lead-based campaigns
- Deal-focused messaging
- Client retention campaigns
- Cross-entity targeting
Real-time Preview
See your audience size and composition before campaign launch
- Live audience count
- Segment composition
- Target validation
- Reach estimation
Targeting Configuration Example
Target Model: Leads
Campaign Analytics & Performance
Performance Metrics
Delivery Rate
Open Rate
Click Rate
Conversion Rate
Real-time Tracking
Audience Insights
ROI Measurement
Campaign Automation & Scheduling
Scheduled Campaigns
Plan and schedule campaigns for optimal delivery timing
- Date and time scheduling
- Timezone optimization
- Recurring campaign setup
- Send time optimization
Trigger-based Automation
Automatically send campaigns based on user actions and events
- Event-triggered campaigns
- Behavioral automation
- Milestone celebrations
- Follow-up sequences
Drip Campaigns
Nurture leads with automated message sequences over time
- Multi-step sequences
- Time-based delivery
- Conditional branching
- Response handling
Campaign Automation Workflow
Integration Examples
// Create a new campaign
$campaign = Campaign::create([
'name' => 'Q4 Product Launch Campaign',
'subject' => 'Discover Our Revolutionary New Product',
'description' => 'Multi-channel campaign to promote new product launch',
'campaign_type' => 'mixed', // email + whatsapp
'target_model_type' => 'Lead',
'target_criteria' => [
'status' => 'qualified',
'source' => ['website', 'referral'],
'custom_fields' => [
'company_size' => ['operator' => '>=', 'value' => 50],
'budget' => ['operator' => '>=', 'value' => 10000]
],
'created_after' => '2025-06-01'
],
'email_content' => view('campaigns.templates.product-launch-email')->render(),
'whatsapp_content' => 'Hi {{first_name}}, exciting news about our new product! 🚀',
'scheduled_at' => '2025-08-20 09:00:00',
'business_id' => auth()->user()->business_id,
'created_by' => auth()->user()->id
]);
// Calculate target audience
$audienceCount = $campaign->recipients->count();
$campaign->update(['total_recipients' => $audienceCount]);
// Set up complex targeting criteria
$targetingCriteria = [
'model_type' => 'Lead',
'conditions' => [
'status_id' => ['operator' => 'in', 'values' => [1, 2, 3]], // New, Qualified, Contacted
'source_id' => ['operator' => 'not_in', 'values' => [5]], // Exclude cold calls
'created_at' => [
'operator' => 'between',
'start' => '2025-01-01',
'end' => '2025-07-31'
],
'custom_fields' => [
'industry' => ['operator' => 'in', 'values' => ['Technology', 'Healthcare']],
'budget_range' => ['operator' => '>=', 'value' => 25000],
'decision_timeline' => ['operator' => 'in', 'values' => ['Immediate', 'Within 3 months']]
]
],
'exclude_conditions' => [
'email_campaigns' => [
'operator' => 'sent_within_days',
'value' => 7 // Don't send if emailed in last 7 days
]
]
];
// Preview audience before campaign creation
$campaignService = new CampaignService();
$audiencePreview = $campaignService->previewAudience($targetingCriteria);
echo "Target Audience: {$audiencePreview['count']} leads";
echo "Segments: " . implode(', ', $audiencePreview['segments']);
// Send campaign with full tracking setup
$campaign = Campaign::find(1);
// Generate recipient list
$recipients = $campaignService->generateRecipientList($campaign);
// Send campaign
$sendResult = $campaignService->sendCampaign($campaign, [
'send_immediately' => false,
'scheduled_at' => $campaign->scheduled_at,
'test_mode' => false,
'tracking_enabled' => true,
'personalization' => [
'first_name' => true,
'company' => true,
'custom_fields' => ['industry', 'position']
]
]);
// Process each recipient
foreach ($recipients as $recipient) {
// Create campaign message record
$message = CampaignMessage::create([
'campaign_id' => $campaign->id,
'recipient_type' => $campaign->campaign_type,
'recipient_id' => $recipient->id,
'recipient_model_type' => $campaign->target_model_type,
'recipient_email' => $recipient->email,
'recipient_phone' => $recipient->phone,
'subject' => $campaign->subject,
'content' => $campaignService->personalizeContent($campaign, $recipient),
'status' => 'pending',
'business_id' => $campaign->business_id
]);
// Add tracking parameters
$trackingData = [
'campaign_id' => $campaign->id,
'message_id' => $message->id,
'recipient_email' => $recipient->email,
'tracking_pixel' => route('read-campaign-email-picture', [
'email' => $recipient->email,
'nid' => $message->id
])
];
$message->update(['tracking_data' => $trackingData]);
}
// Update campaign status
$campaign->update([
'status_id' => 2, // Sending
'sent_at' => now(),
'total_recipients' => $recipients->count()
]);
// Get comprehensive campaign analytics
$campaign = Campaign::with(['messages'])->find(1);
// Calculate performance metrics
$analytics = [
'total_sent' => $campaign->messages()->where('status', 'sent')->count(),
'delivery_rate' => $campaign->sent_count > 0 ?
($campaign->sent_count - $campaign->failed_count) / $campaign->sent_count * 100 : 0,
'open_rate' => $campaign->sent_count > 0 ?
$campaign->opened_count / $campaign->sent_count * 100 : 0,
'click_rate' => $campaign->opened_count > 0 ?
$campaign->clicked_count / $campaign->opened_count * 100 : 0,
'bounce_rate' => $campaign->sent_count > 0 ?
$campaign->failed_count / $campaign->sent_count * 100 : 0
];
// Get detailed message tracking
$messageTracking = CampaignMessage::where('campaign_id', $campaign->id)
->select('status', DB::raw('count(*) as count'))
->groupBy('status')
->pluck('count', 'status')
->toArray();
// Performance by time periods
$hourlyPerformance = CampaignMessage::where('campaign_id', $campaign->id)
->where('opened_at', '>=', $campaign->sent_at)
->select(
DB::raw('HOUR(opened_at) as hour'),
DB::raw('count(*) as opens')
)
->groupBy('hour')
->orderBy('hour')
->get();
// Top performing links (if email campaign)
$linkPerformance = CampaignMessage::where('campaign_id', $campaign->id)
->whereNotNull('clicked_at')
->select('tracking_data->clicked_link as link', DB::raw('count(*) as clicks'))
->groupBy('link')
->orderByDesc('clicks')
->limit(10)
->get();
// Generate performance report
$report = [
'campaign' => $campaign->name,
'metrics' => $analytics,
'message_breakdown' => $messageTracking,
'hourly_opens' => $hourlyPerformance,
'top_links' => $linkPerformance,
'roi' => $campaignService->calculateROI($campaign)
];
return response()->json($report);
Workflows & Automation
Advanced workflow automation with AI agents, visual editor, and intelligent lead management
Intelligent Workflow Automation
MediansCRM's workflow module provides a powerful visual automation platform with AI-powered agents, custom workflow creation, and intelligent lead processing capabilities.

Core Features
Visual Workflow Builder
- Drag-and-drop workflow editor
- Node-based workflow design
- Visual connection mapping
- Real-time workflow validation
- Template workflow library
AI Agent Integration
- Custom AI agent creation
- Pre-built agent templates
- Agent configuration management
- Multi-agent workflows
- Agent performance analytics
Workflow Execution
- Manual and automated triggers
- Real-time execution monitoring
- Error handling and retries
- Execution history tracking
- Performance optimization
Analytics & Reporting
- Workflow performance metrics
- Execution success rates
- Agent usage statistics
- Processing time analysis
- ROI tracking
Workflow Creation & Design
Visual Workflow Editor
Create complex workflows using our intuitive drag-and-drop interface with pre-built nodes and connectors.
Drag & Drop Interface
Intuitive node-based editor for building complex workflows
Pre-built Components
Library of ready-to-use workflow nodes and actions
Real-time Validation
Instant feedback and error detection while building
Template-based Creation
Start with pre-built workflow templates designed for common business processes and customize as needed.
Lead Qualification
Automatically qualify and score incoming leads
Email Follow-up
Automated email sequences for lead nurturing
Deal Processing
Streamline deal creation and assignment
Code-based Workflow
// Create a new workflow
$workflow = Workflow::create([
'name' => 'Lead Processing Workflow',
'description' => 'Automatically process and qualify leads',
'workflow_data' => [
'nodes' => [
[
'id' => 'start',
'type' => 'trigger',
'config' => ['event' => 'lead.created']
],
[
'id' => 'qualify',
'type' => 'agent',
'config' => ['agent_id' => 1]
],
[
'id' => 'assign',
'type' => 'action',
'config' => ['action' => 'assign_lead']
]
],
'connections' => [
['from' => 'start', 'to' => 'qualify'],
['from' => 'qualify', 'to' => 'assign']
]
],
'status' => 'active',
'user_id' => auth()->id(),
'business_id' => auth()->user()->business_id
]);
AI Agents & Intelligence
Leverage AI-powered agents to automate complex tasks and decision-making within your workflows.
Lead Qualification Agent
Automatically analyze and score leads based on predefined criteria and machine learning models
Communication Agent
Handle automated responses, email generation, and customer communication workflows
Data Processing Agent
Extract, transform, and process data from various sources with intelligent data handling
Routing Agent
Intelligently route leads and deals to appropriate team members based on criteria and workload
Agent Configuration
Basic Settings
- Agent name and description
- Agent type and behavior
- Trigger conditions
- Input/output parameters
AI Configuration
- Model selection and parameters
- Training data sources
- Confidence thresholds
- Learning algorithms
Integration Settings
- API connections
- External service integration
- Data source mapping
- Output formatting
Workflow Execution & Monitoring
Execution Triggers
Multiple ways to initiate workflow execution
- Event-based triggers (lead created, deal updated)
- Scheduled execution (time-based)
- Manual triggers
- API-triggered workflows
Real-time Monitoring
Track workflow execution in real-time
- Live execution status
- Node-by-node progress tracking
- Error detection and alerts
- Performance metrics
Error Handling
Robust error handling and recovery
- Automatic retry mechanisms
- Fallback workflows
- Error logging and reporting
- Manual intervention options
Execution Dashboard
Lead Management Workflows
Specialized workflows designed for intelligent lead processing and management.
Lead Qualification Workflow
Automatically qualify leads based on multiple criteria and data points
Lead Assignment Workflow
Intelligently distribute leads to team members based on various factors
Lead Nurturing Workflow
Automated follow-up sequences and personalized communication
Workflow Builder Example
Workflow Analytics & Reports
Performance Analytics
Agent Analytics
Business Impact
Integration Examples
// Create workflow with AI agent integration
$workflow = Workflow::create([
'name' => 'Intelligent Lead Processing',
'description' => 'AI-powered lead qualification and assignment',
'workflow_data' => [
'nodes' => [
[
'id' => 'trigger_1',
'type' => 'trigger',
'config' => [
'event' => 'lead.created',
'conditions' => ['source' => 'website']
]
],
[
'id' => 'agent_1',
'type' => 'ai_agent',
'config' => [
'agent_id' => 'lead_qualifier',
'parameters' => [
'scoring_model' => 'advanced',
'threshold' => 70
]
]
],
[
'id' => 'condition_1',
'type' => 'condition',
'config' => [
'field' => 'lead_score',
'operator' => '>=',
'value' => 70
]
]
],
'connections' => [
['from' => 'trigger_1', 'to' => 'agent_1'],
['from' => 'agent_1', 'to' => 'condition_1']
]
],
'status' => 'active',
'user_id' => auth()->id(),
'business_id' => auth()->user()->business_id
]);
// Publish workflow
$workflow->update(['is_published' => true]);
// Create AI agent for lead qualification
$agent = Agent::create([
'name' => 'Lead Qualification Agent',
'description' => 'AI agent for scoring and qualifying leads',
'type' => 'lead_qualifier',
'config' => [
'model' => 'gpt-4',
'prompt_template' => 'Analyze lead data and provide score 1-100',
'parameters' => [
'temperature' => 0.3,
'max_tokens' => 150,
'criteria' => [
'company_size' => 20,
'budget_range' => 25,
'timeline' => 15,
'decision_maker' => 25,
'fit_score' => 15
]
],
'output_format' => 'json',
'validation_rules' => [
'score' => 'required|numeric|min:0|max:100',
'reasoning' => 'required|string|max:500'
]
],
'status' => 'active',
'user_id' => auth()->id(),
'business_id' => auth()->user()->business_id,
'is_public' => false
]);
// Test agent configuration
$result = $agent->test([
'company' => 'Tech Startup',
'budget' => 50000,
'timeline' => 'Q4 2025',
'contact_level' => 'CTO'
]);
// Execute workflow with lead data
$workflowService = new WorkflowService();
$executionResult = $workflowService->execute($workflow->id, [
'trigger_data' => [
'lead_id' => 123,
'source' => 'website',
'urgency' => 'high'
],
'context' => [
'user_id' => auth()->id(),
'timestamp' => now(),
'session_id' => session()->getId()
]
]);
// Check execution status
if ($executionResult->isSuccessful()) {
$leadScore = $executionResult->getOutput('lead_score');
$assignment = $executionResult->getOutput('assignment');
// Log successful execution
Log::info('Workflow executed successfully', [
'workflow_id' => $workflow->id,
'lead_id' => 123,
'score' => $leadScore,
'execution_id' => $executionResult->getId()
]);
} else {
// Handle execution errors
Log::error('Workflow execution failed', [
'workflow_id' => $workflow->id,
'error' => $executionResult->getError()
]);
}
// Get workflow execution history
$executions = WorkflowExecution::where('workflow_id', $workflow->id)
->with(['workflow', 'nodes'])
->orderBy('created_at', 'desc')
->paginate(20);
// Calculate performance metrics
$metrics = [
'total_executions' => $executions->total(),
'success_rate' => $executions->where('status', 'completed')->count() / $executions->total() * 100,
'average_duration' => $executions->avg('execution_time'),
'error_rate' => $executions->where('status', 'failed')->count() / $executions->total() * 100
];
// Get real-time execution status
$activeExecutions = WorkflowExecution::where('status', 'running')
->where('workflow_id', $workflow->id)
->with('currentNode')
->get();
// Monitor agent performance
$agentMetrics = Agent::withCount(['executions', 'successful_executions'])
->where('business_id', auth()->user()->business_id)
->get()
->map(function ($agent) {
return [
'agent_id' => $agent->id,
'name' => $agent->name,
'success_rate' => $agent->successful_executions_count / max($agent->executions_count, 1) * 100,
'usage_count' => $agent->executions_count
];
});
Email Management
Comprehensive IMAP & SMTP email functionality with account management, automation, and CRM integration
Advanced Email Communication System
MediansCRM's email module provides complete email management with IMAP/SMTP support, multi-account handling, automated fetching, signature management, and seamless CRM integration.

Core Features
Email Account Management
- Multiple IMAP/SMTP accounts
- Provider-specific configurations
- App password support
- Connection testing & validation
- Custom folder synchronization
Email Composition
- Rich HTML email editor
- Template-based composition
- Email signatures
- File attachments
- CC/BCC support
Email Organization
- Folder management
- Message filtering
- Search functionality
- Read/unread tracking
- Favorite marking
Automation & Integration
- Automated email fetching
- Lead/Client integration
- Push notifications
- Template variables
- Email tracking
Email Account Configuration
Manual Email Account Setup
Configure email accounts with custom IMAP and SMTP settings for any email provider.
Setting | Description | Example |
---|---|---|
IMAP Host | Incoming mail server | imap.gmail.com |
IMAP Port | IMAP port number | 993 (SSL) / 143 (TLS) |
IMAP Username | Email address | user@domain.com |
IMAP Password | Email password or app password | •••••••• |
SMTP Host | Outgoing mail server | smtp.gmail.com |
SMTP Port | SMTP port number | 465 (SSL) / 587 (TLS) |
Security Requirements
For Gmail and other providers, enable 2FA and generate app-specific passwords instead of using your regular password.
Provider-Specific Templates
Quick setup using pre-configured templates for popular email providers.
Gmail
Outlook/Office 365
Yahoo Mail
Connection Testing
// Test IMAP connection
$imapConfig = [
'host' => 'imap.gmail.com',
'port' => 993,
'encryption' => 'ssl',
'username' => 'user@gmail.com',
'password' => 'app_password'
];
$emailService = new EmailAccountService();
$connection = $emailService->testImapConnection($imapConfig);
// Test SMTP connection
$smtpConfig = [
'host' => 'smtp.gmail.com',
'port' => 465,
'encryption' => 'ssl',
'username' => 'user@gmail.com',
'password' => 'app_password'
];
$smtpTest = $emailService->testSmtpConnection($smtpConfig);
Email Composition & Management
Rich Email Editor
Create professional emails with advanced formatting and content management
- HTML email composition
- Template integration
- Variable substitution
- Voice input support
Email Signatures
Professional email signatures with HTML support and automatic insertion
- Multiple signature templates
- Default signature setting
- HTML formatting support
- Dynamic content insertion
Attachment Management
Comprehensive file attachment handling with multiple format support
- Multiple file uploads
- Drag & drop interface
- File type validation
- Size limit management
Email Composition Workflow
Account Selection
Choose from configured email accounts
Recipient & Subject
Enter recipient details and email subject
Content Creation
Compose message with templates and signatures
Send & Track
Send email and track delivery status
Templates & Signatures
Email Templates
Standardized email templates with dynamic content and personalization
Email Signatures
Professional signatures with automatic insertion and customization options
Available Template Variables
Contact Information
{{$name}}
Recipient name
{{$email}}
Recipient email
{{$company}}
Company name
Business Information
{{$business_name}}
Your business name
{{$site_url}}
CRM website URL
{{$user}}
Sender information
Content Elements
{{$content}}
Message content
{{$signature}}
Email signature
CRM Integration Features
Lead Integration
Seamless email communication directly from lead profiles
- Lead-specific email history
- Quick email composition
- Email activity tracking
- Automated follow-ups
Client Management
Complete email communication tracking for client relationships
- Client communication history
- Project-related emails
- Service notifications
- Support ticket integration
Email Analytics
Track email performance and engagement metrics
- Delivery tracking
- Open rate monitoring
- Response tracking
- Communication frequency
Email Automation & Scheduling
Automated Email Fetching
Automatically retrieve emails from your accounts at regular intervals
- Configurable fetch frequency
- Selective folder synchronization
- Duplicate email handling
- Error handling & retries
Push Notifications
Real-time notifications for new emails and important messages
- New email alerts
- Account-specific notifications
- Priority email flagging
- Desktop & mobile notifications
Email Scheduling
Schedule emails for optimal delivery timing and follow-up automation
- Send time optimization
- Follow-up sequences
- Time zone handling
- Recurring email setup
Automated Email Fetching Setup
Cron Job Configuration
# Add to crontab for automatic email fetching
*/5 * * * * php /path/to/artisan emails:fetch-emails
Account Settings
- Fetch Limit: 20 emails per sync
- Since Days: 7 days back
- Auto-fetch: Enabled
Implementation Examples
// Create new email account
$emailAccount = EmailAccount::create([
'business_id' => auth()->user()->business_id,
'user_id' => auth()->id(),
'user_type' => get_class(auth()->user()),
'email' => 'user@gmail.com',
'imap_host' => 'imap.gmail.com',
'imap_port' => 993,
'imap_username' => 'user@gmail.com',
'imap_password' => encrypt('app_password'),
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 465,
'smtp_username' => 'user@gmail.com',
'smtp_password' => encrypt('app_password')
]);
// Create CRM folder and fetch initial folders
$emailService = new EmailAccountService($emailAccount);
$emailService->handleCRMFolder($emailAccount);
$emailService->connect($emailAccount)->fetch();
// Compose and send email
$emailData = [
'account_id' => $emailAccount->id,
'email' => 'recipient@example.com',
'cc' => 'cc@example.com',
'subject' => 'Welcome to Our Service',
'message_text' => 'Your custom message content here',
'signature_id' => $defaultSignature->id,
'template_id' => $emailTemplate->id
];
// Handle file attachments
$attachments = [];
if (request()->hasFile('attachments')) {
$attachments[] = request()->file('attachments');
}
// Send email through service
$messageService = new EmailMessageService();
$result = $messageService->sendMail($emailData, $emailAccount, $attachments);
// Track email in CRM folder
$emailMessage = EmailMessage::create([
'account_id' => $emailAccount->id,
'folder_name' => 'CRM',
'subject' => $emailData['subject'],
'sender_email' => $emailAccount->email,
'email' => $emailData['email'],
'message_html' => $emailData['message_text'],
'business_id' => auth()->user()->business_id
]);
// Fetch emails from IMAP server
$emailService = new EmailAccountService($emailAccount);
$messageService = new EmailMessageService();
// Connect to email account
$emailService->connect($emailAccount);
// Get account settings
$days = $emailAccount->field('since_days')->first()->value ?? 7;
$limit = $emailAccount->field('fetch_limit')->first()->value ?? 20;
// Fetch messages from INBOX
$savedMessages = $emailService->fetchMessages('INBOX', $emailAccount, $days, $limit);
// Process each fetched message
foreach ($savedMessages as $message) {
// Save attachments if any exist
if ($message->hasAttachments()) {
$attachments = $messageService->saveMessageAttachments($message, $message);
}
// Send push notification for new emails
if ($emailAccount->user->pushSubscription()) {
$emailAccount->user->notify(new EmailNotification($emailAccount, [$message]));
}
}
// Create professional email signature
$signature = EmailSignature::create([
'business_id' => auth()->user()->business_id,
'user_id' => auth()->id(),
'name' => 'Professional Signature',
'content' => '
Best regards,
' . auth()->user()->name . '
' . (auth()->user()->job_title ?? '') . '
' . (auth()->user()->company_name ?? '') . '
' . (auth()->user()->phone ?? '') . '
' . auth()->user()->email . '
' . config('app.url') . '
',
'is_default' => true,
'is_active' => true
]);
// Use signature service to manage signatures
$signatureService = new EmailSignatureService();
// Get user's default signature
$defaultSignature = $signatureService->getUserDefaultSignature();
// Append signature to email content
$messageWithSignature = $signatureService->appendSignatureToMessage(
$emailContent,
$signature->id
);
Troubleshooting & Performance
Common Issues
Performance Tips
Security Considerations
API Reference
Complete REST API documentation for MediansCRM integration
MediansCRM REST API
The MediansCRM API is a RESTful API that allows you to integrate MediansCRM with your applications, websites, and third-party services. All API responses are returned in JSON format.
Base URL
https://yourcrm.com/api/v1
Authentication
Bearer Token
Rate Limit
1000 requests/hour
API Endpoints
Customers
Deals
API Usage Examples
Customer Management
curl -X POST "https://yourcrm.com/api/v1/customers" \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"company": "Acme Corp",
"source": "website"
}'
Response:
{
"success": true,
"data": {
"id": 123,
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"company": "Acme Corp",
"source": "website",
"status": "active",
"created_at": "2025-08-09T10:30:00Z",
"updated_at": "2025-08-09T10:30:00Z"
}
}
Deal Management
curl -X POST "https://yourcrm.com/api/v1/deals" \
-H "Content-Type: application/json" \
-d '{
"title": "Website Redesign Project",
"value": 15000,
"currency": "USD",
"customer_id": 123,
"stage": "proposal",
"expected_close_date": "2025-09-15"
}'
Webhook Integration
curl -X POST "https://yourcrm.com/api/v1/webhooks" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/crm",
"events": ["customer.created", "deal.updated", "invoice.paid"],
"secret": "your_webhook_secret"
}'
Frequently Asked Questions
Common questions and answers about MediansCRM
Installation & Setup
MediansCRM requires PHP 8.2+, MySQL 5.7+ (or equivalent), and at least 256MB RAM. For optimal performance, we recommend PHP 8.3+, MySQL 8.0+, and 512MB RAM. See the complete system requirements in our installation guide.
Yes, MediansCRM can be installed on shared hosting as long as it meets the system requirements. However, for better performance and security, we recommend VPS or dedicated hosting, especially for production environments.
The automatic installation wizard typically takes 5-10 minutes, depending on your server speed and the number of modules you choose to install. Manual installation may take 15-30 minutes.
Licensing & Usage
Your license includes the complete MediansCRM source code, all modules, 6 months of free updates, documentation, and email support. You can use it for one domain/subdomain per license.
Yes, you have full access to the source code and can customize it according to your needs. However, customizations may affect future updates, so we recommend using the modular architecture for custom features.
Yes, we offer extended licenses for multiple domains, white-label solutions, and commercial distribution. Contact our sales team for custom licensing options.
Features & Functionality
There's no limit on the number of users you can add to MediansCRM. The system is designed to scale with your business, supporting everything from small teams to large enterprises.
Yes, MediansCRM includes integrations for email services, payment gateways (Stripe, PayPal), WhatsApp Business API, and many other services. You can also build custom integrations using our REST API.
MediansCRM is fully responsive and works perfectly on mobile devices through web browsers. We're also developing native mobile apps, which will be available as separate products.
Support & Updates
We provide email support for all customers, comprehensive documentation, video tutorials, and a community forum. Premium support with live chat and phone support is available as an add-on.
We release major updates quarterly and minor updates/bug fixes monthly. All updates include new features, performance improvements, and security patches. You'll receive 6 months of free updates with your license.
Yes, we offer professional installation services for customers who prefer hands-off setup. Our team can install, configure, and customize MediansCRM according to your requirements.