File tree Expand file tree Collapse file tree 1 file changed +48
-1
lines changed Expand file tree Collapse file tree 1 file changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ $ composer install
65
65
66
66
# install app's dependencies
67
67
$ npm install
68
+ ```
69
+
70
+ ### If you choice to use SQLite
71
+
72
+ ``` bash
68
73
69
74
# create database
70
75
$ touch database/database.sqlite
@@ -81,8 +86,50 @@ Then in file ".env" replace this database configuration:
81
86
To this:
82
87
83
88
* DB_CONNECTION=sqlite
84
- * DB_DATABASE=/path_to_your_project/my-project/laravel/database/database.sqlite
89
+ * DB_DATABASE=/path_to_your_project/database/database.sqlite
90
+
91
+ ### If you choice to use PostgreSQL
92
+
93
+ 1 . Install PostgreSQL
94
+
95
+ 2 . Create user
96
+ ``` bash
97
+ $ sudo -u postgres createuser --interactive
98
+ enter name of role to add: laravel
99
+ shall the new role be a superuser (y/n) n
100
+ shall the new role be allowed to create database (y/n) n
101
+ shall the new role be allowed to create more new roles (y/n) n
102
+ ```
103
+ 3 . Set user password
104
+ ``` bash
105
+ $ sudo -u postgres psql
106
+ postgres= ALTER USER laravel WITH ENCRYPTED PASSWORD ' password' ;
107
+ postgres= \q
108
+ ```
109
+ 4 . Create database
110
+ ``` bash
111
+ $ sudo -u postgres createdb laravel
112
+ ```
113
+ 5 . Copy file ".env.example", and change its name to ".env".
114
+ Then in file ".env" replace this database configuration:
115
+
116
+ * DB_CONNECTION=mysql
117
+ * DB_HOST=127.0.0.1
118
+ * DB_PORT=3306
119
+ * DB_DATABASE=laravel
120
+ * DB_USERNAME=root
121
+ * DB_PASSWORD=
122
+
123
+ To this:
124
+
125
+ * DB_CONNECTION=pgsql
126
+ * DB_HOST=127.0.0.1
127
+ * DB_PORT=5432
128
+ * DB_DATABASE=laravel
129
+ * DB_USERNAME=laravel
130
+ * DB_PASSWORD=password
85
131
132
+ ### Next step
86
133
87
134
``` bash
88
135
# in your app directory
You can’t perform that action at this time.
0 commit comments