Skip to content

Commit 08db0c2

Browse files
committed
Kanban board on leads
1 parent a24514c commit 08db0c2

29 files changed

+83913
-12
lines changed

database/seeders/LaravelCrmTablesSeeder.php

Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
use Ramsey\Uuid\Uuid;
77
use Spatie\Permission\Models\Permission;
88
use Spatie\Permission\Models\Role;
9+
use VentureDrake\LaravelCrm\Models\Deal;
10+
use VentureDrake\LaravelCrm\Models\Delivery;
11+
use VentureDrake\LaravelCrm\Models\Invoice;
12+
use VentureDrake\LaravelCrm\Models\Lead;
13+
use VentureDrake\LaravelCrm\Models\Order;
14+
use VentureDrake\LaravelCrm\Models\PurchaseOrder;
15+
use VentureDrake\LaravelCrm\Models\Quote;
916

1017
class LaravelCrmTablesSeeder extends Seeder
1118
{
@@ -200,6 +207,290 @@ public function run()
200207
\VentureDrake\LaravelCrm\Models\ContactType::firstOrCreate($item[0], $item[1]);
201208
}
202209

210+
// Pipelines stage probabilities
211+
$items = [
212+
[
213+
[
214+
'id' => 1,
215+
],
216+
[
217+
'name' => 'New',
218+
'percent' => 1,
219+
],
220+
],
221+
[
222+
[
223+
'id' => 2,
224+
],
225+
[
226+
'name' => '10%',
227+
'percent' => 10,
228+
],
229+
],
230+
[
231+
[
232+
'id' => 3,
233+
],
234+
[
235+
'name' => '20%',
236+
'percent' => 20,
237+
],
238+
],
239+
[
240+
[
241+
'id' => 4,
242+
],
243+
[
244+
'name' => '30%',
245+
'percent' => 30,
246+
],
247+
],
248+
[
249+
[
250+
'id' => 5,
251+
],
252+
[
253+
'name' => '40%',
254+
'percent' => 40,
255+
],
256+
],
257+
[
258+
[
259+
'id' => 6,
260+
],
261+
[
262+
'name' => '50%',
263+
'percent' => 50,
264+
],
265+
],
266+
[
267+
[
268+
'id' => 7,
269+
],
270+
[
271+
'name' => '60%',
272+
'percent' => 60,
273+
],
274+
],
275+
[
276+
[
277+
'id' => 8,
278+
],
279+
[
280+
'name' => '70%',
281+
'percent' => 70,
282+
],
283+
],
284+
[
285+
[
286+
'id' => 9,
287+
],
288+
[
289+
'name' => '80%',
290+
'percent' => 80,
291+
],
292+
],
293+
[
294+
[
295+
'id' => 10,
296+
],
297+
[
298+
'name' => '90%',
299+
'percent' => 90,
300+
],
301+
],
302+
[
303+
[
304+
'id' => 11,
305+
],
306+
[
307+
'name' => 'Won',
308+
'percent' => 100,
309+
],
310+
],
311+
[
312+
[
313+
'id' => 12,
314+
],
315+
[
316+
'name' => 'Lost',
317+
'percent' => 0,
318+
],
319+
],
320+
];
321+
322+
foreach ($items as $item) {
323+
\VentureDrake\LaravelCrm\Models\PipelineStageProbability::firstOrCreate($item[0], $item[1]);
324+
}
325+
326+
// Pipelines
327+
$items = [
328+
[
329+
[
330+
'id' => 1,
331+
],
332+
[
333+
'name' => 'Lead Pipeline',
334+
'model' => get_class(new Lead()),
335+
],
336+
],
337+
[
338+
[
339+
'id' => 2,
340+
],
341+
[
342+
'name' => 'Deal Pipeline',
343+
'model' => get_class(new Deal()),
344+
],
345+
],
346+
[
347+
[
348+
'id' => 3,
349+
],
350+
[
351+
'name' => 'Quote Pipeline',
352+
'model' => get_class(new Quote()),
353+
],
354+
],
355+
[
356+
[
357+
'id' => 4,
358+
],
359+
[
360+
'name' => 'Order Pipeline',
361+
'model' => get_class(new Order()),
362+
],
363+
],
364+
[
365+
[
366+
'id' => 5,
367+
],
368+
[
369+
'name' => 'Invoice Pipeline',
370+
'model' => get_class(new Invoice()),
371+
],
372+
],
373+
[
374+
[
375+
'id' => 6,
376+
],
377+
[
378+
'name' => 'Delivery Pipeline',
379+
'model' => get_class(new Delivery()),
380+
],
381+
],
382+
[
383+
[
384+
'id' => 7,
385+
],
386+
[
387+
'name' => 'Purchase Order Pipeline',
388+
'model' => get_class(new PurchaseOrder()),
389+
],
390+
],
391+
];
392+
393+
foreach ($items as $item) {
394+
\VentureDrake\LaravelCrm\Models\Pipeline::firstOrCreate($item[0], $item[1]);
395+
}
396+
397+
// Pipelines stages
398+
$items = [
399+
[
400+
[
401+
'id' => 1,
402+
],
403+
[
404+
'name' => 'New',
405+
'pipeline_id' => 1,
406+
'pipeline_stage_probability_id' => 1,
407+
],
408+
],
409+
[
410+
[
411+
'id' => 2,
412+
],
413+
[
414+
'name' => 'Appointment Scheduled',
415+
'pipeline_id' => 1,
416+
'pipeline_stage_probability_id' => 3,
417+
],
418+
],
419+
[
420+
[
421+
'id' => 3,
422+
],
423+
[
424+
'name' => 'Qualified To Buy',
425+
'pipeline_id' => 1,
426+
'pipeline_stage_probability_id' => 5,
427+
],
428+
],
429+
[
430+
[
431+
'id' => 4,
432+
],
433+
[
434+
'name' => 'Presentation Scheduled',
435+
'pipeline_id' => 1,
436+
'pipeline_stage_probability_id' => 7,
437+
],
438+
],
439+
[
440+
[
441+
'id' => 5,
442+
],
443+
[
444+
'name' => 'Decision Maker Bought-In',
445+
'pipeline_id' => 1,
446+
'pipeline_stage_probability_id' => 9,
447+
],
448+
],
449+
[
450+
[
451+
'id' => 6,
452+
],
453+
[
454+
'name' => 'Contract Sent',
455+
'pipeline_id' => 1,
456+
'pipeline_stage_probability_id' => 10,
457+
],
458+
],
459+
[
460+
[
461+
'id' => 7,
462+
],
463+
[
464+
'name' => 'Closed Won',
465+
'pipeline_id' => 1,
466+
'pipeline_stage_probability_id' => 11,
467+
],
468+
],
469+
[
470+
[
471+
'id' => 8,
472+
],
473+
[
474+
'name' => 'Closed Lost',
475+
'pipeline_id' => 1,
476+
'pipeline_stage_probability_id' => 12,
477+
],
478+
],
479+
];
480+
481+
482+
// Add all the default stages for various pipelines
483+
// Deals
484+
// Quotes
485+
// Orders
486+
// Invoices
487+
// Deliveries
488+
// Purchase Orders
489+
490+
foreach ($items as $item) {
491+
\VentureDrake\LaravelCrm\Models\PipelineStage::firstOrCreate($item[0], $item[1]);
492+
}
493+
203494
$timestamp = time();
204495
foreach (timezone_identifiers_list() as $zone) {
205496
date_default_timezone_set($zone);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"jquery-datetimepicker": "^2.5.21",
3333
"knockout": "^3.5.1",
3434
"select2": "^4.1.0-rc.0",
35+
"sortablejs": "^1.15.2",
3536
"sweetalert2": "^10.14.0",
3637
"trix": "^2.0.0"
3738
},

resources/assets/css/app.css

Lines changed: 10006 additions & 8 deletions
Large diffs are not rendered by default.

resources/assets/css/document.css

Lines changed: 9266 additions & 1 deletion
Large diffs are not rendered by default.

resources/assets/js/app.js

Lines changed: 63624 additions & 2 deletions
Large diffs are not rendered by default.

resources/js/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import bsCustomFileInput from 'bs-custom-file-input'
1212

1313
const Swal = require('sweetalert2')
1414

15+
window.Sortable = require('sortablejs').default;
16+
1517
// Little bit of Jquery
1618
const appJquery = function() {
1719
return {

resources/lang/en/lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,4 +485,5 @@
485485
'pickup' => 'pickup',
486486
'unreject' => 'unreject',
487487
'quote_unrejected' => 'quote unrejected',
488+
'stage' => 'stage'
488489
];

resources/views/layouts/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
</div>
8383
</footer>
8484
</div>
85-
<script src="{{ asset('vendor/laravel-crm/js/app.js') }}?v=35674846787"></script>
85+
<script src="{{ asset('vendor/laravel-crm/js/app.js') }}?v=32456547687"></script>
8686
<script src="{{ asset('vendor/laravel-crm/libs/bootstrap-multiselect/bootstrap-multiselect.min.js') }}"></script>
8787
<script src="https://cdn.jsdelivr.net/npm/bs-custom-file-input/dist/bs-custom-file-input.min.js"></script>
8888
@livewireScripts

resources/views/leads/board.blade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@extends('laravel-crm::layouts.app')
2+
3+
@section('content')
4+
5+
@include('laravel-crm::leads.partials.card-board')
6+
7+
@endsection
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@component('laravel-crm::components.card')
2+
3+
@component('laravel-crm::components.card-header')
4+
5+
@slot('title')
6+
{{ ucfirst(__('laravel-crm::lang.leads')) }}
7+
@endslot
8+
9+
@slot('actions')
10+
@include('laravel-crm::partials.view-types', [
11+
'model' => 'leads',
12+
])
13+
@include('laravel-crm::partials.filters', [
14+
'action' => route('laravel-crm.leads.filter'),
15+
'model' => '\VentureDrake\LaravelCrm\Models\Lead'
16+
])
17+
@can('create crm leads')
18+
<a type="button" class="btn btn-primary btn-sm" href="{{ url(route('laravel-crm.leads.create')) }}"><span class="fa fa-plus"></span> {{ ucfirst(__('laravel-crm::lang.add_lead')) }}</a>
19+
@endcan
20+
@endslot
21+
22+
@endcomponent
23+
24+
@component('laravel-crm::components.card-table')
25+
26+
<livewire:live-lead-board />
27+
28+
@endcomponent
29+
30+
@endcomponent

0 commit comments

Comments
 (0)