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: README.md
+31-10Lines changed: 31 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,28 +12,49 @@
12
12
13
13
### 1. Set up Infisical
14
14
15
-
This assumes you have a working Infisical account and have created a project with secrets.
15
+
- Set up an Infisical account if you haven't already. Create a project with secrets.
16
+
- Install the Infisical CLI tool on your device by following the instructions at [Infisical CLI Installation](https://docs.infisical.com/cli/installation).
16
17
17
-
1. Install the Infisical CLI tool on your device by following the instructions at [Infisical CLI Installation](https://docs.infisical.com/cli/installation).
18
-
2. Run `infisical login` to authenticate.
19
-
3. Run `infisical init` to select the project and generate the `.infisical.json` file. We recommend committing this file to your repository.
18
+
### 2. Authenticate and configure your project
20
19
21
-
### 2. Install this package
20
+
You can authenticate and configure your project in one of two ways:
21
+
22
+
-**Login with identity**:
23
+
24
+
Run [`infisical login`](https://infisical.com/docs/cli/commands/login) to authenticate with a user identity or a machine identity.
25
+
26
+
Then run [`infisical init`](https://infisical.com/docs/cli/commands/init) to select the project and generate the `.infisical.json` file. We recommend committing this file to your repository.
27
+
28
+
29
+
-**Use a service token**:
30
+
31
+
Create a Service Token scoped for your designed environment.
32
+
33
+
Copy your specific Project ID from your Infisical settings page.
34
+
35
+
Set the following environment variables in your base `.env` file:
36
+
37
+
```dotenv
38
+
INFISICAL_PROJECT_ID=your-project-id
39
+
INFISICAL_TOKEN=your-service-token
40
+
```
41
+
42
+
### 3. Install this package
22
43
23
44
You know the drill:
24
45
25
46
```bash
26
47
composer require stechstudio/laravel-infisical
27
48
```
28
49
29
-
### 3. Specify your environment
50
+
### 4. Specify your environment
30
51
31
52
Infisical needs to know which environment to pull secrets from. You can do this one of three ways:
32
53
33
-
-**Environment Variable**: Set the `INFISICAL_ENV` environment variable in a base `.env` file to the desired environment slug.
54
+
-**Environment Variable**: Set the `INFISICAL_ENVIRONMENT` environment variable in a base `.env` file to the desired environment slug.
34
55
35
56
```dotenv
36
-
INFISICAL_ENV=prod
57
+
INFISICAL_ENVIRONMENT=prod
37
58
```
38
59
-**CLI Argument**: Pass the `--env` option when running the Artisan command.
39
60
@@ -54,7 +75,7 @@ Infisical needs to know which environment to pull secrets from. You can do this
54
75
> [!IMPORTANT]
55
76
> You must provide the _slug_ of an existing environment. See your project Settings > Secrets Management page to view all your environments and slugs.
56
77
57
-
### 4. Run the command (manually or automatically)
78
+
### 5. Run the command (manually or automatically)
58
79
59
80
You can run the command manually to merge secrets into your `.env` file, or add it to your deployment scripts.
60
81
@@ -70,7 +91,7 @@ You can also add this to the `scripts` section of your `composer.json` file. Thi
70
91
],
71
92
```
72
93
73
-
### 5. Profit!
94
+
### 6. Profit!
74
95
75
96
You should see "Environment [prod] variables merged successfully". If you look at your `.env` file you should see that all the secrets from Infisical have been added to it.
0 commit comments