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
+130-6Lines changed: 130 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,11 @@ Explore this project and experience the convenience of a ready-made local develo
10
10
11
11
## Features
12
12
13
-
-**Authentication using Laravel Sanctum**: Implement secure authentication using [Laravel Sanctum](https://laravel.com/docs/11.x/sanctum).
13
+
-**Authentication using Laravel Sanctum**: Implement secure authentication using [Laravel Sanctum](https://laravel.com/docs/11.x/sanctum).
14
14
15
-
-**Role & Permission-Based Authorization**: Utilize [Laravel Permission](https://spatie.be/docs/laravel-permission/v6/introduction) for a flexible authorization system based on roles and permissions.
16
-
17
-
-**Multiple Language Support**: Provide a multilingual experience with [Laravel Lang](https://laravel-lang.com/) to make your application accessible to a diverse user base.
15
+
-**Role & Permission-Based Authorization**: Utilize [Laravel Permission](https://spatie.be/docs/laravel-permission/v6/introduction) for a flexible authorization system based on roles and permissions.
18
16
17
+
-**Multiple Language Support**: Provide a multilingual experience with [Laravel Lang](https://laravel-lang.com/) to make your application accessible to a diverse user base.
To fix PHP lint issues and run the Code Style Fixer, use the following command:
101
99
@@ -111,7 +109,9 @@ Open your web browser or use a tool like `curl` to access the health check endpo
111
109
```bash
112
110
http://127.0.0.1:8000/api/healthz
113
111
```
112
+
114
113
Upon hitting the health check endpoint, the app should respond with a JSON object similar to the following:
114
+
115
115
```json
116
116
{
117
117
"cache": true,
@@ -128,8 +128,125 @@ Verifying the health of your application is an essential step to ensure that all
128
128
129
129
Remember to perform this health check regularly, especially after making significant changes to your application or its environment.
130
130
131
+
## XSECURE Setup
132
+
133
+
IMS introduces an additional layer of security, enhancing the API's reliability and resilience. With this system, only applications possessing a shared `XSECURITY_TOKEN` can send API requests to the server; others will be blocked. To get started, follow the guide below.
134
+
135
+
### Getting Started
136
+
137
+
By default, XSecure is disabled! To enable it, set the `XSECURITY_ENABLED` value to true in your `.env` file:
138
+
139
+
```bash
140
+
XSECURITY_ENABLED=true
141
+
```
142
+
143
+
Other wise it will be disabled.
144
+
145
+
### Installation
146
+
147
+
Execute the following command to set up XSECURE:
148
+
149
+
```bash
150
+
php artisan xsecure:install
151
+
```
152
+
153
+
This command generates a secret for your application and updates your .env file with the `XSECURITY_SECRET` field.
154
+
155
+
After running the command, you will receive output similar to this:
This header will authenticate and authorize your requests, ensuring secure communication with the backend server.
235
+
236
+
### Handling Invalid Tokens
237
+
238
+
If you send an invalid token, you will receive a JSON response like this:
239
+
240
+
```bash
241
+
{
242
+
"error": "Invalid XSECURE token"
243
+
}
244
+
```
245
+
131
246
## Running Test
247
+
132
248
To execute tests for your application, utilize the following command:
249
+
133
250
```bash
134
251
./vendor/bin/pest
135
252
```
@@ -141,23 +258,31 @@ php artisan test
141
258
Running tests is crucial to ensure the reliability and correctness of your application's functionality. The above command will initiate the testing process and provide you with valuable insights into the quality of your codebase.
142
259
143
260
## Extra Artisan Commands
261
+
144
262
This project provides additional Artisan commands to simplify your workflow and enhance productivity.
145
263
146
264
### Run PHP CS Fixer
265
+
147
266
```bash
148
267
php artisan csfixer:run
149
268
```
269
+
150
270
This command ensures that your code adheres to the predefined coding standards, making your codebase clean and readable.
271
+
151
272
### Create a Service
273
+
152
274
Creating services for your application is made effortless. Use the following command to generate a service:
275
+
153
276
```bash
154
277
php artisan make:service subfolder/ServiceName
155
278
```
279
+
156
280
Replace subfolder and ServiceName with the actual values you need. You can also create a service without a subfolder:
157
281
158
282
```bash
159
283
php artisan make:service TestService
160
284
```
285
+
161
286
The newly created service will be located at `app/Http/Services/TestService.php`, ready to handle your application's business logic.
162
287
163
288
Leverage these Artisan commands to streamline your development process and maintain a well-structured codebase.
@@ -171,4 +296,3 @@ Leverage these Artisan commands to streamline your development process and maint
171
296
This project is brought to you by Innovix Matrix System and is released as open-source software under the [MIT license](https://opensource.org/licenses/MIT).
172
297
173
298
Feel free to use, modify, and distribute this starter project in accordance with the MIT license terms. We encourage collaboration and welcome contributions from the community to make this project even better.
0 commit comments