Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 49b30a4

Browse files
authored
Merge pull request #25 from ibnsultan/v3.x
Added a csrf config file
2 parents 98b133a + 0ab4212 commit 49b30a4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

config/csrf.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| CSRF Configuration
6+
|--------------------------------------------------------------------------
7+
|
8+
| This file contains the configuration for CSRF protection.
9+
| CSRF protection is important in preventing
10+
| Cross Site Request Forgery attacks.
11+
|
12+
|
13+
| EXCEPT: An array of routes to exclude from CSRF protection
14+
| the csrf exempted routes routes can be defined
15+
| explicitly i.e 'sample/route'
16+
| or with expressions i.e 'route/{int|slug|any|all}'
17+
|
18+
| @expression {int} - Integer values
19+
| @expression {slug} - Alphanumerical values
20+
| @expression {any} - Every character except slashes (/)
21+
| @expression {wild} - Every character including slashes
22+
|
23+
*/
24+
25+
return [
26+
'SECRET_KEY' => '_token',
27+
'SECRET' => getenv('APP_KEY'),
28+
'METHODS' => ['POST', 'PUT', 'PATCH', 'DELETE'],
29+
'EXCEPT' => [
30+
// ... route list
31+
]
32+
];

0 commit comments

Comments
 (0)