Skip to content

Commit 505a316

Browse files
committed
Add README.md (EN and FR)
1 parent 81e70fd commit 505a316

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
*Si vous souhaitez lire ce fichier README en français, [cliquez ici](https://github.com/WinXaito/laravel-https/blob/master/README_fr.md).*
2+
3+
# Laravel HTTPS redirection
4+
This package aims to redirect your HTTP requests to HTTPS very simply.
5+
6+
## Installation
7+
8+
*NB: This package has not been tested below Laravel 5.5*
9+
10+
11+
First, use the function below:
12+
13+
```
14+
composer require winxaito/laravel-https
15+
```
16+
17+
If you don't use auto-discovery, add the ServiceProvider to the providers
18+
array in `config/app.php`
19+
20+
```php
21+
WinXaito\LaravelHttpsRedirect\LaravelHttpsServiceProvider::class,
22+
```
23+
24+
If you want to work with the configurations without going through an environment
25+
file, run the following command and then edit the `config/https-redirection.php`
26+
file
27+
28+
```php
29+
php artisan vendor:publish --provider="WinXaito\LaravelHttpsRedirect\LaravelHttpsServiceProvider"
30+
```
31+
32+
## How to use it ?
33+
34+
This package works with environment variables in order of priority.
35+
List of constants in order of priority:
36+
37+
- `HTTPS_FORCE`: If this value is true, then in all cases the requests will be
38+
redirected to *HTTPS*, otherwise we go to the following constant:
39+
- `HTTPS_PROHIBIT`: If this constant is true, the queries will not be redirected,
40+
if it is false, then we go to the following constant:
41+
- `APP_ENV`: If this constant is *production*, then we redirect to *HTTPS*,
42+
otherwise we go to the following constant:
43+
- `APP_DEBUG`: If the application is not in debug mode, it is redirected to
44+
*HTTPS*, unless *HTTPS_PROHIBIT* is true. If the application is in debug mode
45+
then the address will not be redirected.
46+
47+
48+
By default if no environment variable is defined we have the following values:
49+
50+
- `HTTPS_FORCE = false`
51+
- `HTTPS_PROHIBIT = false`
52+
- `APP_ENV = production`
53+
- `APP_DEBUG = false`
54+
55+
Therefore by default the redirection is enabled.
56+
57+
## License
58+
59+
The license is GNU GPL3, therefore if you use this you must respect the
60+
indications of the license. For proprietary software that would like to
61+
use this library without making their source code available, please contact me.

README_fr.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Laravel HTTPS redirection
2+
Ce package a pour but de rediriger vos requêtes HTTP vers de l'HTTPS très simplement.
3+
4+
## Installation
5+
6+
*NB: Ce package n'a pas été testé en dessous de Laravel 5.5*
7+
8+
9+
Tout d'abord, utiliser la fonction ci-dessous:
10+
11+
```
12+
composer require winxaito/laravel-https
13+
```
14+
15+
Si vous n'utiliez pas l'auto-discovery, ajouter ce ServiceProvider aux tableaux
16+
de providers dans `config/app.php`
17+
18+
```php
19+
WinXaito\LaravelHttpsRedirect\LaravelHttpsServiceProvider::class,
20+
```
21+
22+
Si vous souhaitez travailler avec les configurations sans passer par un fichier
23+
d'environnement, exécuter la commande suivante et modifier ensuite le fichier
24+
`config/https-redirection.php`
25+
26+
```php
27+
php artisan vendor:publish --provider="WinXaito\LaravelHttpsRedirect\LaravelHttpsServiceProvider"
28+
```
29+
30+
## Comment utiliser ce package ?
31+
32+
Ce package fonctionne avec les variables d'environnement dans un ordre de priorités.
33+
34+
Liste des constantes par ordre de priorités:
35+
36+
- HTTPS_FORCE: Si cette valeur est vrai, alors dans tous les cas les requêtes seront redirigé en HTTPS, sinon on passe à la constante suivante:
37+
- HTTPS_PROHIBIT: Si cette constante est vrai, les requêtes ne seront pas redirigé, si elle est fausse, alors on passe à la constante suivante:
38+
- APP_ENV: Si cette constante vaut "production", alors on redirige en HTTPS, sinon on passe à la constante suivante:
39+
- APP_DEBUG: Si l'application n'est pas en mode debug, on redirige en HTTPS, sauf si HTTPS_PROHIBIT est vrai. Si l'application est en mode debug alors l'adresse ne sera pas redirigé.
40+
41+
Par défaut si aucune variable d'environnement est défini nous avons les valeurs suivantes:
42+
43+
- `HTTPS_FORCE=false`
44+
- `HTTPS_PROHIBIT=false`
45+
- `APP_ENV=production`
46+
- `APP_DEBUG=false`
47+
48+
Donc par défaut la redirection est activé.
49+
50+
## License
51+
52+
La license est GNU GPL3, par conséquent en cas d'utilisation de ce vous devez
53+
respecter les indications de la license. Pour les logiciels propriétaires qui
54+
aimerait utiliser cette bibliothèque sans rendre leur code source disponible,
55+
merci de me contacter.

0 commit comments

Comments
 (0)