You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started/install.md
+23-48Lines changed: 23 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,12 @@ Require it with an explicit version constraint allowing its desired stability.
54
54
55
55
## Initial Setup
56
56
57
+
There are a few setup items to do before you can start using Shield in
58
+
your project.
59
+
57
60
### Command Setup
58
61
59
-
1. Run the following command. This command handles steps 1-5 of *Manual Setup* and runs the migrations.
62
+
1. Run the following command. This command handles steps 1-6 of *Manual Setup*.
60
63
61
64
```console
62
65
php spark shield:setup
@@ -67,36 +70,8 @@ Require it with an explicit version constraint allowing its desired stability.
67
70
If you want to customize table names, you must change the table names before running database migrations.
68
71
See [Customizing Table Names](../customization/table_names.md).
69
72
70
-
2. Configure **app/Config/Email.php** to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).
71
-
72
-
```php
73
-
<?php
74
-
75
-
namespace Config;
76
-
77
-
use CodeIgniter\Config\BaseConfig;
78
-
79
-
class Email extends BaseConfig
80
-
{
81
-
/**
82
-
* @var string
83
-
*/
84
-
public $fromEmail = 'your_mail@example.com';
85
-
86
-
/**
87
-
* @var string
88
-
*/
89
-
public $fromName = 'your name';
90
-
91
-
// ...
92
-
}
93
-
```
94
-
95
73
### Manual Setup
96
74
97
-
There are a few setup items to do before you can start using Shield in
98
-
your project.
99
-
100
75
1. Copy the **Auth.php**, **AuthGroups.php**, and **AuthToken.php** from **vendor/codeigniter4/shield/src/Config/** into your project's config folder and update the namespace to `Config`. You will also need to have these classes extend the original classes. See the example below. These files contain all the settings, group, and permission information for your application and will need to be modified to meet the needs of your site.
101
76
102
77
```php
@@ -138,25 +113,7 @@ your project.
138
113
139
114
4. **Security Setup** Set `Config\Security::$csrfProtection` to `'session'` for security reasons, if you use Session Authenticator.
140
115
141
-
5. **Migration** Run the migrations.
142
-
143
-
!!! note
144
-
145
-
If you want to customize table names, you must change the table names before running database migrations.
146
-
See [Customizing Table Names](../customization/table_names.md).
147
-
148
-
```console
149
-
php spark migrate --all
150
-
```
151
-
152
-
#### Note: migration error
153
-
154
-
When you run `spark migrate --all`, if you get `Class "SQLite3" not found` error:
155
-
156
-
1. Remove sample migration files in **tests/_support/Database/Migrations/**
157
-
2. Or install `sqlite3` php extension
158
-
159
-
6. Configure **app/Config/Email.php** to allow Shield to send emails.
116
+
5. Configure **app/Config/Email.php** to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).
160
117
161
118
```php
162
119
<?php
@@ -180,3 +137,21 @@ your project.
180
137
// ...
181
138
}
182
139
```
140
+
141
+
6. **Migration** Run the migrations.
142
+
143
+
!!! note
144
+
145
+
If you want to customize table names, you must change the table names before running database migrations.
146
+
See [Customizing Table Names](../customization/table_names.md).
147
+
148
+
```console
149
+
php spark migrate --all
150
+
```
151
+
152
+
#### Note: migration error
153
+
154
+
When you run `spark migrate --all`, if you get `Class "SQLite3" not found` error:
155
+
156
+
1. Remove sample migration files in **tests/_support/Database/Migrations/**
0 commit comments