File size: 2,151 Bytes
5f32fbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php

namespace Database\Seeders;

use App\Models\Introduction;
use Illuminate\Database\Seeder;

class IntroductionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $this->createAllIntroduction();
    }

    private function createAllIntroduction(): void
    {
        $introductions = [
            [
                'key'   => 'initialize',
                'intro' => "Welcome to MagicAI. Let's take a quick tour",
                'order' => 1,
            ],
            [
                'key'   => 'ai_writer',
                'intro' => 'A great tool for using the Text Generator & AI Copywriting Assistant.',
                'order' => 2,
            ],
            [
                'key'   => 'ai_image',
                'intro' => 'A great tool for using the Text Generator & AI Copywriting Assistant.',
                'order' => 3,
            ],
            [
                'key'   => 'ai_pdf',
                'intro' => 'Simply upload a PDF, find specific information. extract key insights or summarize the entire document.',
                'order' => 4,
            ],
            [
                'key'   => 'ai_code',
                'intro' => 'Generate high quality code in seconds.',
                'order' => 5,
            ],
            [
                'key'   => 'select_plan',
                'intro' => 'Choose the plan that suits you and start creating right away.',
                'order' => 6,
            ],
            [
                'key'   => 'affiliate_send',
                'intro' => 'Invite your friends and start earning commissions.',
                'order' => 7,
            ],
        ];

        foreach ($introductions as $introduction) {
            $this->createIntro(...$introduction);
        }
    }

    private function createIntro(string $key, string $intro, int $order): void
    {
        Introduction::query()
            ->firstOrCreate([
                'key' => $key,
            ], [
                'key'   => $key,
                'intro' => $intro,
                'order' => $order,
            ]);
    }
}