File tree Expand file tree Collapse file tree 3 files changed +68
-9
lines changed Expand file tree Collapse file tree 3 files changed +68
-9
lines changed Original file line number Diff line number Diff line change 1
- Laravel Environments ![ CircleCI ] ( https://circleci.com/gh/highsolutions/laravel-environments.svg?style=svg ) ![ StyleCI ] ( https://styleci.io/repos/118597081/shield?branch=master )
1
+ Laravel Environments
2
2
================
3
3
4
+ ![ CircleCI] ( https://circleci.com/gh/highsolutions/laravel-environments.svg?style=svg ) ![ StyleCI] ( https://styleci.io/repos/118597081/shield?branch=master ) [ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square )] ( https://opensource.org/licenses/MIT )
5
+
4
6
Easy management of different environments in Laravel projects.
5
7
6
8
![ Laravel-Environments by HighSolutions] ( https://github.com/highsolutions/laravel-environments/master/intro.jpg )
@@ -18,10 +20,18 @@ Or by adding the following line to the `require` section of your Laravel webapp'
18
20
19
21
``` javascript
20
22
" require" : {
21
- " HighSolutions/laravel-environments" : " 1 .*"
23
+ " HighSolutions/laravel-environments" : " 2 .*"
22
24
}
23
25
```
24
26
27
+ If you are using Laravel <= 5.4, update ` config/app.php ` by adding an entry for the service provider:
28
+
29
+ ``` php
30
+ 'providers' => [
31
+ // ...
32
+ HighSolutions\LaravelEnvironments\EnvironmentServiceProvider::class,
33
+ ];
34
+
25
35
Optionally, publish the configuration file if you want to change any defaults:
26
36
27
37
```bash
@@ -118,6 +128,9 @@ vendor/bin/phpunit
118
128
Changelog
119
129
---------
120
130
131
+ 2.0.0
132
+ * Support for all Laravel 5.* versions (to-date)
133
+
121
134
1.6.0
122
135
* Laravel 5.6 support
123
136
Original file line number Diff line number Diff line change 10
10
],
11
11
"license" : " MIT" ,
12
12
"require" : {
13
- "php" : " >=7.1.3 " ,
14
- "illuminate/console" : " ~5.6.0 " ,
15
- "illuminate/support" : " ~5.1 "
13
+ "php" : " >=5.4.0 " ,
14
+ "illuminate/console" : " 5.* " ,
15
+ "illuminate/support" : " 5.* "
16
16
},
17
17
"require-dev" : {
18
- "phpunit/phpunit" : " ^7.0 " ,
19
- "orchestra/testbench" : " ~3.6.0 " ,
18
+ "phpunit/phpunit" : " 6.*|7.* " ,
19
+ "orchestra/testbench" : " 3.* " ,
20
20
"mockery/mockery" : " ^1.0"
21
21
},
22
22
"autoload" : {
23
23
"psr-4" : {
24
24
"HighSolutions\\ LaravelEnvironments\\ " : " src/"
25
- }
25
+ },
26
+ "files" : [
27
+ " src/helpers.php"
28
+ ]
26
29
},
27
30
"autoload-dev" : {
28
31
"psr-4" : {
34
37
},
35
38
"extra" : {
36
39
"component" : " package" ,
37
- "frameworks" : [" Laravel 5.6" ],
40
+ "frameworks" : [
41
+ " Laravel 5.0" ,
42
+ " Laravel 5.1" ,
43
+ " Laravel 5.2" ,
44
+ " Laravel 5.3" ,
45
+ " Laravel 5.4" ,
46
+ " Laravel 5.5" ,
47
+ " Laravel 5.6"
48
+ ],
38
49
"laravel" : {
39
50
"providers" : [
40
51
" HighSolutions\\ LaravelEnvironments\\ EnvironmentServiceProvider"
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * Helpers compatibility
5
+ */
6
+
7
+ if (! function_exists ('str_before ' )) {
8
+ /**
9
+ * Get the portion of a string before a given value.
10
+ *
11
+ * @param string $subject
12
+ * @param string $search
13
+ * @return string
14
+ */
15
+ function str_before ($ subject , $ search )
16
+ {
17
+ return $ search === '' ? $ subject : explode ($ search , $ subject )[0 ];
18
+ }
19
+ }
20
+
21
+ if (! function_exists ('str_finish ' )) {
22
+ /**
23
+ * Cap a string with a single instance of a given value.
24
+ *
25
+ * @param string $value
26
+ * @param string $cap
27
+ * @return string
28
+ */
29
+ function str_finish ($ value , $ cap )
30
+ {
31
+ $ quoted = preg_quote ($ cap , '/ ' );
32
+
33
+ return preg_replace ('/(?: ' .$ quoted .')+$/u ' , '' , $ value ).$ cap ;
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments