File tree Expand file tree Collapse file tree 4 files changed +66
-2
lines changed Expand file tree Collapse file tree 4 files changed +66
-2
lines changed Original file line number Diff line number Diff line change 55 "type" : " library" ,
66 "require" : {
77 "php" : " ^7.4" ,
8- "laravel/framework " : " ~ 8.0"
8+ "laravel/support " : " ^7.0|^ 8.0"
99 },
1010 "require-dev" : {
1111 "orchestra/testbench" : " ^5.2" ,
3232 "extra" : {
3333 "laravel" : {
3434 "providers" : [
35+ " Soved\\ Laravel\\ Snapshot\\ SnapshotServiceProvider"
3536 ]
3637 }
3738 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [];
Original file line number Diff line number Diff line change 66## Requirements
77
88- PHP >= 7.4
9- - Laravel >= 8 .0
9+ - Laravel >= 7 .0
1010
1111## Security Vulnerabilities
1212
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Soved \Laravel \Snapshot ;
4+
5+ use Illuminate \Support \ServiceProvider ;
6+ use Laravel \Lumen \Application as LumenApplication ;
7+ use Illuminate \Foundation \Application as LaravelApplication ;
8+
9+ class SnapshotServiceProvider extends ServiceProvider
10+ {
11+ /**
12+ * Bootstrap the application services.
13+ *
14+ * @return void
15+ */
16+ public function boot ()
17+ {
18+ }
19+
20+ /**
21+ * Register the application services.
22+ *
23+ * @return void
24+ */
25+ public function register ()
26+ {
27+ $ this ->configure ();
28+ $ this ->offerPublishing ();
29+ }
30+
31+ /**
32+ * Setup the configuration.
33+ *
34+ * @return void
35+ */
36+ protected function configure ()
37+ {
38+ $ source = realpath ($ raw = __DIR__ .'/../config/snapshot.php ' ) ?: $ raw ;
39+
40+ if ($ this ->app instanceof LumenApplication) {
41+ $ this ->app ->configure ('snapshot ' );
42+ }
43+
44+ $ this ->mergeConfigFrom ($ source , 'snapshot ' );
45+ }
46+
47+ /**
48+ * Setup the resource publishing groups.
49+ *
50+ * @return void
51+ */
52+ protected function offerPublishing ()
53+ {
54+ if ($ this ->app instanceof LaravelApplication && $ this ->app ->runningInConsole ()) {
55+ $ this ->publishes ([
56+ __DIR__ .'/../config/snapshot.php ' => config_path ('snapshot.php ' ),
57+ ], 'snapshot-config ' );
58+ }
59+ }
60+ }
You can’t perform that action at this time.
0 commit comments