Skip to content

Commit b6d9634

Browse files
feat: Laravel 9 Support added (#994)
* feat: Laravel 9 support added * chore: PHP upgrades to 8.0 for tests * feat: autoload config from service provider
1 parent c00a3ea commit b6d9634

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup PHP
2222
uses: shivammathur/setup-php@v1
2323
with:
24-
php-version: 7.3
24+
php-version: 8.0
2525
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
2626
coverage: none
2727

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^7.3|^8.0",
28-
"illuminate/support": "^8.0",
29-
"laracasts/flash": "^3.2"
27+
"php": "^8.0",
28+
"illuminate/support": "^9.0",
29+
"laracasts/flash": "^3.2",
30+
"laravelcollective/html": "^6.3"
3031
},
3132
"require-dev": {
32-
"phpunit/phpunit": "^9.0|^9.3.3",
33-
"mockery/mockery": "^1.3.1"
33+
"phpunit/phpunit": "^9.5.10",
34+
"mockery/mockery": "^1.4.4"
3435
},
3536
"autoload": {
3637
"psr-4": {

src/InfyOmGeneratorServiceProvider.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ class InfyOmGeneratorServiceProvider extends ServiceProvider
3030
*/
3131
public function boot()
3232
{
33-
$configPath = __DIR__.'/../config/laravel_generator.php';
34-
35-
$this->publishes([
36-
$configPath => config_path('infyom/laravel_generator.php'),
37-
]);
33+
if ($this->app->runningInConsole()) {
34+
$configPath = __DIR__.'/../config/laravel_generator.php';
35+
$this->publishes([
36+
$configPath => config_path('infyom/laravel_generator.php'),
37+
]);
38+
}
3839
}
3940

4041
/**
@@ -44,6 +45,8 @@ public function boot()
4445
*/
4546
public function register()
4647
{
48+
$this->mergeConfigFrom(__DIR__.'/../config/laravel_generator.php', 'infyom.laravel_generator');
49+
4750
$this->app->singleton('infyom.publish', function ($app) {
4851
return new GeneratorPublishCommand();
4952
});

0 commit comments

Comments
 (0)