Skip to content

Commit 3720e1b

Browse files
committed
Seeding various pipeline default stages
1 parent 7103050 commit 3720e1b

File tree

2 files changed

+268
-10
lines changed

2 files changed

+268
-10
lines changed

config/package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
|
1414
*/
1515

16-
'version' => '1.1.0',
16+
'version' => '1.2.0',
1717

1818
];

database/seeders/LaravelCrmTablesSeeder.php

Lines changed: 267 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ public function run()
396396

397397
// Pipelines stages
398398
$items = [
399+
// Leads
399400
[
400401
[
401402
'id' => 1,
@@ -476,17 +477,274 @@ public function run()
476477
'pipeline_stage_probability_id' => 12,
477478
],
478479
],
480+
// Deals
481+
[
482+
[
483+
'id' => 9,
484+
],
485+
[
486+
'name' => 'Draft',
487+
'pipeline_id' => 2,
488+
'pipeline_stage_probability_id' => 1,
489+
],
490+
],
491+
[
492+
[
493+
'id' => 10,
494+
],
495+
[
496+
'name' => 'Pending',
497+
'pipeline_id' => 2,
498+
'pipeline_stage_probability_id' => 9,
499+
],
500+
],
501+
[
502+
[
503+
'id' => 11,
504+
],
505+
[
506+
'name' => 'Closed Won',
507+
'pipeline_id' => 2,
508+
'pipeline_stage_probability_id' => 11,
509+
],
510+
],
511+
[
512+
[
513+
'id' => 12,
514+
],
515+
[
516+
'name' => 'Closed Lost',
517+
'pipeline_id' => 2,
518+
'pipeline_stage_probability_id' => 12,
519+
],
520+
],
521+
// Quotes
522+
[
523+
[
524+
'id' => 13,
525+
],
526+
[
527+
'name' => 'Draft',
528+
'pipeline_id' => 3,
529+
'pipeline_stage_probability_id' => 1,
530+
],
531+
],
532+
[
533+
[
534+
'id' => 14,
535+
],
536+
[
537+
'name' => 'Sent',
538+
'pipeline_id' => 3,
539+
'pipeline_stage_probability_id' => 9,
540+
],
541+
],
542+
[
543+
[
544+
'id' => 15,
545+
],
546+
[
547+
'name' => 'Accepted',
548+
'pipeline_id' => 3,
549+
'pipeline_stage_probability_id' => 11,
550+
],
551+
],
552+
[
553+
[
554+
'id' => 16,
555+
],
556+
[
557+
'name' => 'Rejected',
558+
'pipeline_id' => 3,
559+
'pipeline_stage_probability_id' => 12,
560+
],
561+
],
562+
[
563+
[
564+
'id' => 17,
565+
],
566+
[
567+
'name' => 'Ordered',
568+
'pipeline_id' => 3,
569+
'pipeline_stage_probability_id' => 11,
570+
],
571+
],
572+
// Orders
573+
[
574+
[
575+
'id' => 18,
576+
],
577+
[
578+
'name' => 'Draft',
579+
'pipeline_id' => 4,
580+
'pipeline_stage_probability_id' => 1,
581+
],
582+
],
583+
[
584+
[
585+
'id' => 19,
586+
],
587+
[
588+
'name' => 'Open',
589+
'pipeline_id' => 4,
590+
'pipeline_stage_probability_id' => 9,
591+
],
592+
],
593+
[
594+
[
595+
'id' => 20,
596+
],
597+
[
598+
'name' => 'Invoiced',
599+
'pipeline_id' => 4,
600+
'pipeline_stage_probability_id' => 11,
601+
],
602+
],
603+
[
604+
[
605+
'id' => 21,
606+
],
607+
[
608+
'name' => 'Delivered',
609+
'pipeline_id' => 4,
610+
'pipeline_stage_probability_id' => 11,
611+
],
612+
],
613+
[
614+
[
615+
'id' => 22,
616+
],
617+
[
618+
'name' => 'Completed',
619+
'pipeline_id' => 4,
620+
'pipeline_stage_probability_id' => 11,
621+
],
622+
],
623+
// Invoices
624+
[
625+
[
626+
'id' => 23,
627+
],
628+
[
629+
'name' => 'Draft',
630+
'pipeline_id' => 5,
631+
'pipeline_stage_probability_id' => 1,
632+
],
633+
],
634+
[
635+
[
636+
'id' => 24,
637+
],
638+
[
639+
'name' => 'Awaiting Approval',
640+
'pipeline_id' => 5,
641+
'pipeline_stage_probability_id' => 5,
642+
],
643+
],
644+
[
645+
[
646+
'id' => 25,
647+
],
648+
[
649+
'name' => 'Awaiting Payment',
650+
'pipeline_id' => 5,
651+
'pipeline_stage_probability_id' => 9,
652+
],
653+
],
654+
[
655+
[
656+
'id' => 26,
657+
],
658+
[
659+
'name' => 'Paid',
660+
'pipeline_id' => 5,
661+
'pipeline_stage_probability_id' => 11,
662+
],
663+
],
664+
// Deliveries
665+
[
666+
[
667+
'id' => 27,
668+
],
669+
[
670+
'name' => 'Draft',
671+
'pipeline_id' => 6,
672+
'pipeline_stage_probability_id' => 1,
673+
],
674+
],
675+
[
676+
[
677+
'id' => 28,
678+
],
679+
[
680+
'name' => 'Packed',
681+
'pipeline_id' => 6,
682+
'pipeline_stage_probability_id' => 9,
683+
],
684+
],
685+
[
686+
[
687+
'id' => 29,
688+
],
689+
[
690+
'name' => 'Sent',
691+
'pipeline_id' => 6,
692+
'pipeline_stage_probability_id' => 11,
693+
],
694+
],
695+
[
696+
[
697+
'id' => 30,
698+
],
699+
[
700+
'name' => 'Delivered',
701+
'pipeline_id' => 6,
702+
'pipeline_stage_probability_id' => 11,
703+
],
704+
],
705+
// Purchase Orders
706+
[
707+
[
708+
'id' => 31,
709+
],
710+
[
711+
'name' => 'Draft',
712+
'pipeline_id' => 7,
713+
'pipeline_stage_probability_id' => 1,
714+
],
715+
],
716+
[
717+
[
718+
'id' => 32,
719+
],
720+
[
721+
'name' => 'Awaiting Approval',
722+
'pipeline_id' => 7,
723+
'pipeline_stage_probability_id' => 5,
724+
],
725+
],
726+
[
727+
[
728+
'id' => 33,
729+
],
730+
[
731+
'name' => 'Approved',
732+
'pipeline_id' => 7,
733+
'pipeline_stage_probability_id' => 9,
734+
],
735+
],
736+
[
737+
[
738+
'id' => 34,
739+
],
740+
[
741+
'name' => 'Paid',
742+
'pipeline_id' => 7,
743+
'pipeline_stage_probability_id' => 11,
744+
],
745+
],
479746
];
480747

481-
482-
// Add all the default stages for various pipelines
483-
// Deals
484-
// Quotes
485-
// Orders
486-
// Invoices
487-
// Deliveries
488-
// Purchase Orders
489-
490748
foreach ($items as $item) {
491749
\VentureDrake\LaravelCrm\Models\PipelineStage::firstOrCreate($item[0], $item[1]);
492750
}

0 commit comments

Comments
 (0)