-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy patho.html
More file actions
121 lines (107 loc) · 4.32 KB
/
Copy patho.html
File metadata and controls
121 lines (107 loc) · 4.32 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!--Section: Docs content-->
<section>
<section id="intro">
<!-- Main title -->
<h2 class="h1 fw-bold"><?= $data_var['main_title']; ?></h2>
<!-- Seo title -->
<h1 class="h6"><?= $data_var['seo_title']; ?></h1>
<!-- Description -->
<p>
This guide will show you how to create and publish Laravel project and MySQL database with MDB
GO.
</p>
</section>
<hr class="my-5" />
<section id="introduction">
<!-- Section title -->
<h2 class="mb-4">Initialize Laravel project</h2>
<div class="row">
<div class="col-md-12">
<p>We will go through the following steps:</p>
<ul>
<li>Create a MySQL database named <code>todo_app</code></li>
<li>Create Laravel project</li>
</ul>
<p>Let's go!</p>
<h3>Creating MySQL database</h3>
<p>In order to create a new database you need to run the following command:</p>
<mdbsnippet>
<code data-lang="shell" data-name="Shell">
$ mdb database init -db mysql8
</code>
</mdbsnippet>
<p>
Now you need to provide your user data and then the database details. Please provide the
values of your choice. For example:
</p>
<pre><code>? Enter username thor
? Enter password Mjolnir_1
? Repeat password Mjolnir_1
? Enter database name todo_app
? Enter description Database for the TODO app
</code></pre>
<p class="note note-warning">
<strong>Note:</strong> the password must contain <i>at least</i> one uppercase letter, one
lowercase letter, one number, one special symbol and have minimum length of 8.
</p>
<p>Hit <kbd>Enter</kbd> and it's done.</p>
<p>
Please notice that in the command output the username and database name slightly differs
from what you provided earlier. Don't worry - it's OK. A few random characters have been
added to these values to randomize them and improve security of your database credentials.
</p>
<p class="note note-danger">
<strong>Important:</strong> Do not close your terminal window until you save your
credentials somewhere. This is the only time we will show you your database password. If
you won't save it you'll loose it.
</p>
<h3>Creating Laravel project</h3>
<p>In order to initialize and use predefined Laravel starter run the following command:</p>
<!--prettier-ignore-->
<mdbsnippet>
<code data-lang="shell" data-name="Shell">
$ mdb backend init
</code>
</mdbsnippet>
<p>and choose <code>Laravel starter</code> from the list that shows up.</p>
<p>
After initialization just go to the newly created project directory and open the
<code>.env</code> file. After that edit the config values that start with
<code>DB_</code>. You should make use of credentials that's been shown to you in the
previous step. In my case the updated values look like this:
</p>
<pre><code>DB_CONNECTION=mysql
DB_HOST=mysql.db.mdbgo.com
DB_PORT=3306
DB_DATABASE=todo_app48a0ca47
DB_USERNAME=thor83ad51bf
DB_PASSWORD=Mjolnir_1
</code></pre>
<p>
The starter project is ready to use. You don't have to change anything to run the example
app for the sake of this tutorial. Simply publish it using the following command:
</p>
<mdbsnippet>
<code data-lang="shell" data-name="Shell">
$ mdb publish -p php-laravel
</code>
</mdbsnippet>
<p>
After your files get uploaded you can access your app under the address shown in the
output.
</p>
<p class="note note-danger">
<strong>Note:</strong> You may want to check
<a href="https://mdbgo.com/docs/tutorials/node/">the tutorial</a> where we explain in
detail what can go wrong here and how to deal with it.
</p>
<p class="note note-warning">
<strong>Note:</strong> Since we need to install dependencies and run your app, it may take
a few moments until it will be available under the provided URL.
</p>
</div>
</div>
</section>
<!--Section: Docs content-->
</section>
<!--Section: Docs content-->