File tree Expand file tree Collapse file tree 4 files changed +38
-14
lines changed Expand file tree Collapse file tree 4 files changed +38
-14
lines changed Original file line number Diff line number Diff line change @@ -37,16 +37,16 @@ Checkout the [1.0 branch](https://github.com/GrahamCampbell/Laravel-Parse/tree/1
37
37
38
38
## Configuration
39
39
40
- Laravel Parse requires configuration through [ orchestral/config ] ( https://github.com/orchestral/config ) .
40
+ Laravel Parse requires configuration/
41
41
42
- If you want an automated way to publish the config, then install [ orchestral/publisher] ( https://github.com/orchestral/publisher ) .
43
-
44
- You can then publish the config file by running:
42
+ To get started, you'll need to publish all vendor assets:
45
43
46
44
``` bash
47
- $ php artisan publish:config graham-campbell/parse
45
+ $ php artisan vendor:publish
48
46
```
49
47
48
+ This will create a ` config/parse.php ` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
49
+
50
50
There are three config options:
51
51
52
52
##### Parse App Id
Original file line number Diff line number Diff line change 11
11
],
12
12
"require" : {
13
13
"php" : " >=5.4.7" ,
14
+ "illuminate/contracts" : " 5.0.*" ,
14
15
"illuminate/support" : " 5.0.*" ,
15
- "orchestra/config" : " 3.0.*" ,
16
- "orchestra/support-providers" : " 3.0.*" ,
17
16
"parse/php-sdk" : " ~1.0"
18
17
},
19
18
"require-dev" : {
File renamed without changes.
Original file line number Diff line number Diff line change 11
11
12
12
namespace GrahamCampbell \Parse ;
13
13
14
- use Orchestra \Support \Providers \ServiceProvider ;
14
+ use Illuminate \Contracts \Foundation \Application ;
15
+ use Illuminate \Support \ServiceProvider ;
15
16
use Parse \ParseClient ;
16
17
17
18
/**
@@ -28,13 +29,37 @@ class ParseServiceProvider extends ServiceProvider
28
29
*/
29
30
public function boot ()
30
31
{
31
- $ this ->addConfigComponent ( ' graham-campbell/parse ' , ' graham-campbell/parse ' , realpath ( __DIR__ . ' /../config ' ) );
32
+ $ this ->setupConfig ( );
32
33
33
- ParseClient::initialize (
34
- $ this ->app ->config ->get ('graham-campbell/parse::app_id ' ),
35
- $ this ->app ->config ->get ('graham-campbell/parse::rest_key ' ),
36
- $ this ->app ->config ->get ('graham-campbell/parse::master_key ' )
37
- );
34
+ $ this ->setupParse ($ this ->app );
35
+ }
36
+
37
+ /**
38
+ * Setup the config.
39
+ *
40
+ * @return void
41
+ */
42
+ protected function setupConfig ()
43
+ {
44
+ $ source = realpath (__DIR__ .'/../config/parse.php ' );
45
+
46
+ $ this ->publishes ([$ source => config_path ('parse.php ' )]);
47
+
48
+ $ this ->mergeConfigFrom ('parse ' , $ source );
49
+ }
50
+
51
+ /**
52
+ * Setup parse.
53
+ *
54
+ * @param \Illuminate\Contracts\Foundation\Application $app
55
+ *
56
+ * @return void
57
+ */
58
+ protected function setupParse (Application $ app )
59
+ {
60
+ $ config = $ app ->config ->get ('parse ' );
61
+
62
+ ParseClient::initialize ($ config ['app_id ' ], $ config ['rest_key ' ], $ config ['master_key ' ]);
38
63
}
39
64
40
65
/**
You can’t perform that action at this time.
0 commit comments