diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml
new file mode 100644
index 0000000..0281309
--- /dev/null
+++ b/.github/workflows/dependabot-auto-merge.yml
@@ -0,0 +1,32 @@
+name: Dependabot auto-merge
+on: pull_request_target
+
+permissions:
+ pull-requests: write
+ contents: write
+
+jobs:
+ dependabot:
+ runs-on: ubuntu-latest
+ if: ${{ github.actor == 'dependabot[bot]' }}
+ steps:
+
+ - name: Dependabot metadata
+ id: metadata
+ uses: dependabot/fetch-metadata@v1.6.0
+ with:
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
+
+ - name: Auto-merge Dependabot PRs for semver-major updates
+ if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
+ run: gh pr merge --auto --merge "$PR_URL"
+ env:
+ PR_URL: ${{github.event.pull_request.html_url}}
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+
+ - name: Auto-merge Dependabot PRs for semver-patch updates
+ if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
+ run: gh pr merge --auto --merge "$PR_URL"
+ env:
+ PR_URL: ${{github.event.pull_request.html_url}}
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml
new file mode 100644
index 0000000..802d168
--- /dev/null
+++ b/.github/workflows/php-cs-fixer.yml
@@ -0,0 +1,26 @@
+name: Check & fix styling
+
+on: [push]
+
+permissions:
+ contents: write
+
+jobs:
+ php-cs-fixer:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.head_ref }}
+
+ - name: Run PHP CS Fixer
+ uses: docker://oskarstark/php-cs-fixer-ga
+ with:
+ args: --config=.php-cs-fixer.dist.php --allow-risky=yes
+
+ - name: Commit changes
+ uses: stefanzweifel/git-auto-commit-action@v5
+ with:
+ commit_message: Fix styling
diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml
new file mode 100644
index 0000000..ff3cbb0
--- /dev/null
+++ b/.github/workflows/phpstan.yml
@@ -0,0 +1,32 @@
+name: PHPStan
+
+on: [push, pull_request]
+
+jobs:
+ phpstan:
+ runs-on: ${{ matrix.os }}
+ name: PHPStan - P${{ matrix.php }}
+
+ strategy:
+ matrix:
+ os: [ ubuntu-latest ]
+ php: [ '8.1', '8.2', '8.3' ]
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@2.26.0
+ with:
+ php-version: ${{ matrix.php }}
+
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Install dependencies
+ run: |
+ composer install --no-interaction --no-progress --no-suggest
+
+ - name: Run PHPStan
+ run: |
+ composer analyse --error-format=github
diff --git a/.github/workflows/setup_test.yml b/.github/workflows/setup_test.yml
new file mode 100644
index 0000000..f1b2866
--- /dev/null
+++ b/.github/workflows/setup_test.yml
@@ -0,0 +1,34 @@
+name: Setup & test
+
+on: [ push, pull_request ]
+
+jobs:
+ tests:
+ name: Composer P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ ubuntu-latest ]
+ php: [ '8.1', '8.2', '8.3' ]
+ laravel: [ 10.*, 9.* ]
+ include:
+ - laravel: 10.*
+ testbench: 8.*
+ - laravel: 9.*
+ testbench: 8.*
+ steps:
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Install dependencies
+ run: |
+ composer install --no-interaction --no-progress --no-suggest
+
+ - name: Run tests
+ run: |
+ composer validate --strict
diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml
new file mode 100644
index 0000000..acd4c1d
--- /dev/null
+++ b/.github/workflows/update-changelog.yml
@@ -0,0 +1,31 @@
+name: Update Changelog
+
+on:
+ release:
+ types: [released]
+
+permissions:
+ contents: write
+
+jobs:
+ update:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ ref: main
+
+ - name: Update Changelog
+ uses: stefanzweifel/changelog-updater-action@v1
+ with:
+ latest-version: ${{ github.event.release.name }}
+ release-notes: ${{ github.event.release.body }}
+
+ - name: Commit updated CHANGELOG
+ uses: stefanzweifel/git-auto-commit-action@v5
+ with:
+ branch: main
+ commit_message: Update CHANGELOG
+ file_pattern: CHANGELOG.md
diff --git a/.gitignore b/.gitignore
index b4ddc5f..d216841 100755
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,8 @@ npm-debug.log
package-lock.json
yarn.lock
-/.sass-cache
\ No newline at end of file
+/.sass-cache
+
+build
+.php-cs-fixer.cache
+storage
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..001df5e
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,40 @@
+in([
+ __DIR__ . '/src',
+ __DIR__ . '/tests',
+ __DIR__ . '/routes',
+ __DIR__ . '/resources',
+ ])
+ ->name('*.php')
+ ->ignoreDotFiles(true)
+ ->ignoreVCS(true);
+
+return (new PhpCsFixer\Config())
+ ->setRules([
+ '@PSR12' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'ordered_imports' => ['sort_algorithm' => 'alpha'],
+ 'no_unused_imports' => true,
+ 'trailing_comma_in_multiline' => true,
+ 'phpdoc_scalar' => true,
+ 'unary_operator_spaces' => true,
+ 'binary_operator_spaces' => true,
+ 'blank_line_before_statement' => [
+ 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
+ ],
+ 'phpdoc_single_line_var_spacing' => true,
+ 'phpdoc_var_without_name' => true,
+ 'class_attributes_separation' => [
+ 'elements' => [
+ 'method' => 'one',
+ ],
+ ],
+ 'method_argument_space' => [
+ 'on_multiline' => 'ensure_fully_multiline',
+ 'keep_multiple_spaces_after_comma' => true,
+ ],
+ 'single_trait_insert_per_statement' => true,
+ ])
+ ->setFinder($finder);
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..cd82b96
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Changelog
+
+Here you can see the full list of changes between each Laravel Generator release.
+
+## v1.0 - 2023-06-26
+
+- Experimental release
diff --git a/LICENSE b/LICENSE
index 8cc32b7..792c300 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023 Tan Nguyen
+Copyright (c) 2023 CSlant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 2ff0c20..ce54596 100755
--- a/README.md
+++ b/README.md
@@ -2,16 +2,17 @@
This package is used to generate models, controllers, views, routes, migrations, seeders, factories, requests, and more for Laravel.
-[![Latest Version](https://img.shields.io/github/release/lbiltech/laravel-generator.svg?style=flat-square)](https://github.com/lbiltech/laravel-generator/releases)
-[![Total Downloads](https://img.shields.io/packagist/dt/lbiltech/laravel-generator.svg?style=flat-square)](https://packagist.org/packages/lbiltech/laravel-generator)
+[![Latest Version](https://img.shields.io/github/release/cslant/laravel-generator.svg?style=flat-square)](https://github.com/cslant/laravel-generator/releases)
+[![Total Downloads](https://img.shields.io/packagist/dt/cslant/laravel-generator.svg?style=flat-square)](https://packagist.org/packages/cslant/laravel-generator)
+![Test Status](https://img.shields.io/github/actions/workflow/status/cslant/laravel-generator/setup_test.yml?label=tests&branch=main)
[![StyleCI](https://styleci.io/repos/605697295/shield)](https://styleci.io/repos/605697295)
-[![Quality Score](https://img.shields.io/scrutinizer/g/lbiltech/laravel-generator.svg?style=flat-square)](https://scrutinizer-ci.com/g/lbiltech/laravel-generator)
-[![Maintainability](https://api.codeclimate.com/v1/badges/231c123bfa276fd1ac3c/maintainability)](https://codeclimate.com/github/lbiltech/laravel-generator/maintainability)
+[![Quality Score](https://img.shields.io/scrutinizer/g/cslant/laravel-generator.svg?style=flat-square)](https://scrutinizer-ci.com/g/cslant/laravel-generator)
+[![Maintainability](https://api.codeclimate.com/v1/badges/231c123bfa276fd1ac3c/maintainability)](https://codeclimate.com/github/cslant/laravel-generator/maintainability)
## Technology
-- PHP ^7.3|^8.0
-- Laravel Framework 8.x, 9.x, 10.x
+- PHP ^8.1
+- Laravel Framework 9.x, 10.x
- Composer
## Installation
@@ -19,7 +20,7 @@ This package is used to generate models, controllers, views, routes, migrations,
You can install the package with [Composer](https://getcomposer.org/) using the following command:
```bash
-composer require lbiltech/laravel-generator
+composer require cslant/laravel-generator
```
## Publish the config file, views, and language files
@@ -27,7 +28,7 @@ composer require lbiltech/laravel-generator
If you want to change the default configuration, the views, or the language files, you can publish them with the following command:
```bash
- php artisan vendor:publish --provider="Lbil\LaravelGenerator\Providers\LaravelGeneratorServiceProvider"
+ php artisan vendor:publish --provider="CSlant\LaravelGenerator\Providers\LaravelGeneratorServiceProvider"
```
If you have run the above command, you will see the following files in your project:
@@ -40,13 +41,13 @@ If you have run the above command, you will see the following files in your proj
Also, you can publish only the config file with the following command:
```bash
- php artisan vendor:publish --provider="Lbil\LaravelGenerator\Providers\LaravelGeneratorServiceProvider" --tag="config"
+ php artisan vendor:publish --provider="CSlant\LaravelGenerator\Providers\LaravelGeneratorServiceProvider" --tag="config"
```
Similarly, you can publish only the views with the following command:
```bash
- php artisan vendor:publish --provider="Lbil\LaravelGenerator\Providers\LaravelGeneratorServiceProvider" --tag="views"
+ php artisan vendor:publish --provider="CSlant\LaravelGenerator\Providers\LaravelGeneratorServiceProvider" --tag="views"
```
@@ -55,7 +56,7 @@ Similarly, you can publish only the views with the following command:
The MIT License (MIT). Please see [License File](LICENSE) for more information.
-
+
diff --git a/common/helpers.php b/common/helpers.php
index c40045b..488cd78 100644
--- a/common/helpers.php
+++ b/common/helpers.php
@@ -1,6 +1,6 @@
$asset], $useAbsolutePath).'?v='.filemtime($file);
}
@@ -53,7 +53,7 @@ function laravel_generator_asset(string $asset): string
/**
* Returns asset allowed from laravel-generator composer package.
*
- * @param $asset string
+ * @param string $asset
* @return string
*
* @throws LaravelGeneratorException
diff --git a/composer.json b/composer.json
index 0c0b92f..ad71834 100755
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
- "name": "lbiltech/laravel-generator",
+ "name": "cslant/laravel-generator",
"description": "Laravel Generator",
- "homepage": "https://github.com/lbiltech/laravel-generator",
+ "homepage": "https://github.com/cslant/laravel-generator",
"type": "library",
"license": "MIT",
"keywords": [
@@ -10,23 +10,24 @@
"crud generator",
"migration generator",
"model generator",
- "controller",
+ "controller generator",
"repository",
"request",
"resource",
"factory",
"seeder",
"action",
- "laravel-generator"
+ "laravel generator",
+ "cslant"
],
"autoload": {
"psr-4": {
- "Lbil\\LaravelGenerator\\": "src/"
+ "CSlant\\LaravelGenerator\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
- "Lbil\\LaravelGenerator\\Tests\\": "tests/"
+ "CSlant\\LaravelGenerator\\Tests\\": "tests/"
}
},
"authors": [
@@ -40,23 +41,38 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
- "php": "^7.3|^8.0|^8.1",
- "laravel/framework": "^8.0|^9.0|^10.0",
- "lbiltech/laravel-generator-ui": "^v1.0.0"
+ "php": "^8.1",
+ "laravel/framework": "^9.0|^10.0",
+ "cslant/laravel-generator-ui": "^v1.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.5|^10.0",
- "mockery/mockery": "^1.5",
- "ext-openssl": "*"
+ "friendsofphp/php-cs-fixer": "^v3.0",
+ "nunomaduro/collision": "^7.0",
+ "nunomaduro/larastan": "^2.0",
+ "orchestra/testbench": "^8.0",
+ "pestphp/pest": "^2.3",
+ "phpstan/extension-installer": "^1.3",
+ "phpstan/phpstan-deprecation-rules": "^1.1",
+ "phpstan/phpstan-phpunit": "^1.3"
+ },
+ "scripts": {
+ "analyse": "vendor/bin/phpstan analyse",
+ "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
},
"support": {
- "issues": "https://github.com/lbiltech/laravel-generator/issues"
+ "issues": "https://github.com/cslant/laravel-generator/issues"
},
"extra": {
"laravel": {
"providers": [
- "Lbil\\LaravelGenerator\\Providers\\LaravelGeneratorServiceProvider"
+ "CSlant\\LaravelGenerator\\Providers\\LaravelGeneratorServiceProvider"
]
}
+ },
+ "config": {
+ "allow-plugins": {
+ "pestphp/pest-plugin": true,
+ "phpstan/extension-installer": true
+ }
}
}
diff --git a/config/laravel-generator.php b/config/laravel-generator.php
index ce8c508..0ef5a25 100644
--- a/config/laravel-generator.php
+++ b/config/laravel-generator.php
@@ -11,27 +11,25 @@
'routes' => [
/* Route for laravel generator tool */
- 'tool' => env('TH_LARAVEL_GENERATOR_URL', 'laravel-generator'),
+ 'tool' => env('TH_LARAVEL_GENERATOR_TOOL_ROUTE', 'laravel-generator'),
],
],
],
'defaults' => [
'paths' => [
- /*
- * Edit to include full URL in ui for assets
- */
+ /* Edit to include full URL in ui for assets */
'use_absolute_path' => env('TH_LARAVEL_GENERATOR_USE_ABSOLUTE_PATH', true),
'views' => base_path('resources/views/vendor/laravel-generator'),
- 'ui_package_path' => 'vendor/lbil/laravel-generator-ui',
+ 'ui_package_path' => 'vendor/cslant/laravel-generator-ui',
'assets_folder' => 'dist/',
'laravel_generator_assets_path' => env(
'TH_LARAVEL_GENERATOR_ASSETS_PATH',
- 'vendor/lbil/laravel-generator-ui/dist/'
+ 'vendor/cslant/laravel-generator-ui/dist/'
),
],
],
diff --git a/lang/ja/generator.php b/lang/ja/generator.php
new file mode 100644
index 0000000..087d7e1
--- /dev/null
+++ b/lang/ja/generator.php
@@ -0,0 +1,6 @@
+ 'Laravel ジェネレーター',
+ 'dashboard' => 'Laravel ジェネレーター ダッシュボード',
+];
diff --git a/lang/ja/settings.php b/lang/ja/settings.php
new file mode 100644
index 0000000..e49f92b
--- /dev/null
+++ b/lang/ja/settings.php
@@ -0,0 +1,17 @@
+ 'UI 構成',
+ 'description' => 'デスクトップの sidenav スタイルのみを変更できます。',
+ 'see_options' => 'オプションを見る',
+ 'sidebar' => [
+ 'color' => 'サイドバーの色',
+ 'nav_type' => 'ナビゲーションタイプ',
+ 'nav_description' => 'ナビゲーションのタイプを選択します。',
+ 'nav_fixed' => 'ナビゲーションを固定',
+ 'dark' => 'ダーク',
+ 'light' => 'ライト',
+ 'transparent' => '透明',
+ 'dashboard' => 'ダッシュボード',
+ ],
+];
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
new file mode 100644
index 0000000..e69de29
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
new file mode 100644
index 0000000..dba5a52
--- /dev/null
+++ b/phpstan.neon.dist
@@ -0,0 +1,12 @@
+includes:
+ - phpstan-baseline.neon
+
+parameters:
+ level: 9
+ paths:
+ - src
+ - routes
+ tmpDir: build/phpstan
+ checkOctaneCompatibility: true
+ checkModelProperties: true
+ checkMissingIterableValueType: false
diff --git a/phpunit.xml b/phpunit.xml
index f2e7bde..afdc875 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -13,7 +13,7 @@
-
+
tests
diff --git a/resources/views/shared/left_bar.blade.php b/resources/views/shared/left_bar.blade.php
index 6b75f9a..6bb89a0 100644
--- a/resources/views/shared/left_bar.blade.php
+++ b/resources/views/shared/left_bar.blade.php
@@ -1,7 +1,7 @@
\ No newline at end of file
+
diff --git a/routes/web.php b/routes/web.php
index b274e62..f6a675c 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,13 +1,13 @@
group(function () {
+Route::namespace('CSlant\LaravelGenerator\Http\Controllers')->group(function () {
$configRepository = resolve(ConfigHelper::class);
$generatorConfig = $configRepository->generatorConfig();
diff --git a/src/Exceptions/LaravelGeneratorException.php b/src/Exceptions/LaravelGeneratorException.php
index 23c7b6a..33bac18 100644
--- a/src/Exceptions/LaravelGeneratorException.php
+++ b/src/Exceptions/LaravelGeneratorException.php
@@ -1,6 +1,6 @@
isAssociativeArray($value)
) {
$merged[$key] = $this->mergeConfig($defaults[$key], $value);
+
continue;
}
diff --git a/src/Http/Controllers/Asset/AssetController.php b/src/Http/Controllers/Asset/AssetController.php
index 61f5f8f..d674923 100644
--- a/src/Http/Controllers/Asset/AssetController.php
+++ b/src/Http/Controllers/Asset/AssetController.php
@@ -1,6 +1,6 @@
offsetGet('asset');
diff --git a/src/Http/Controllers/Detect/DetectController.php b/src/Http/Controllers/Detect/DetectController.php
index fb6b733..844436b 100644
--- a/src/Http/Controllers/Detect/DetectController.php
+++ b/src/Http/Controllers/Detect/DetectController.php
@@ -1,6 +1,6 @@
isRepositoryClass($class):
$type = 'repository';
+
break;
case $this->isServiceClass($class):
$type = 'service';
+
break;
case $this->isControllerClass($class):
$type = 'controller';
+
break;
case $this->isActionClass($class):
$type = 'action';
+
break;
}
@@ -93,7 +97,7 @@ protected function getClassType(ReflectionClass $class)
* @param ReflectionClass $class
* @return bool
*/
- public function isRepositoryClass(ReflectionClass $class)
+ public function isRepositoryClass(ReflectionClass $class): bool
{
return $this->checkClassType($class, 'repository');
}
@@ -106,7 +110,7 @@ public function isRepositoryClass(ReflectionClass $class)
* @param $type
* @return bool
*/
- protected function checkClassType(ReflectionClass $class, $type)
+ protected function checkClassType(ReflectionClass $class, $type): bool
{
$type = ucfirst($type);
@@ -122,7 +126,7 @@ protected function checkClassType(ReflectionClass $class, $type)
* @param ReflectionClass $class
* @return bool
*/
- protected function implementsCrudMethods(ReflectionClass $class)
+ protected function implementsCrudMethods(ReflectionClass $class): bool
{
$methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
$crudMethods = [
@@ -145,7 +149,7 @@ protected function implementsCrudMethods(ReflectionClass $class)
* @param ReflectionClass $class
* @return bool
*/
- private function dependsOnModels(ReflectionClass $class)
+ private function dependsOnModels(ReflectionClass $class): bool
{
$dependencies = $class->getConstructor()->getParameters();
foreach ($dependencies as $dependency) {
@@ -164,7 +168,7 @@ private function dependsOnModels(ReflectionClass $class)
* @param ReflectionClass $class
* @return bool
*/
- public function isServiceClass(ReflectionClass $class)
+ public function isServiceClass(ReflectionClass $class): bool
{
return $this->checkClassType($class, 'service');
}
@@ -178,7 +182,7 @@ public function isServiceClass(ReflectionClass $class)
* @param ReflectionClass $class
* @return bool
*/
- public function isControllerClass(ReflectionClass $class)
+ public function isControllerClass(ReflectionClass $class): bool
{
return $this->checkClassType($class, 'controller');
}
@@ -190,7 +194,7 @@ public function isControllerClass(ReflectionClass $class)
* @param ReflectionClass $class
* @return bool
*/
- public function isActionClass(ReflectionClass $class)
+ public function isActionClass(ReflectionClass $class): bool
{
return $this->checkClassType($class, 'action');
}
diff --git a/src/Http/Controllers/Generator/GeneratorController.php b/src/Http/Controllers/Generator/GeneratorController.php
index f74b77a..e8a7607 100644
--- a/src/Http/Controllers/Generator/GeneratorController.php
+++ b/src/Http/Controllers/Generator/GeneratorController.php
@@ -1,6 +1,6 @@
loadViewsFrom($viewPath, 'laravel-generator');
- // Publish a config file
- $configPath = __DIR__.'/../../config/laravel-generator.php';
- $this->publishes([
- $configPath => config_path('laravel-generator.php'),
- ], 'config');
-
- // Publish views
- $this->publishes([
- __DIR__.'/../../resources/views' => config('laravel-generator.defaults.paths.views'),
- ], 'views');
-
- // Include routes
$routePath = __DIR__.'/../../routes/web.php';
if (file_exists($routePath)) {
$this->loadRoutesFrom($routePath);
}
+ $this->loadTranslationsFrom(__DIR__.'/../../lang', 'laravel-generator');
+
// Load package helpers file
$helpersPath = __DIR__.'/../../common/helpers.php';
if (file_exists($helpersPath)) {
require_once $helpersPath;
}
- // Load language files
- $this->loadTranslationsFrom(__DIR__.'/../../lang', 'laravel-generator');
-
- // Publish language files
- $this->publishes([
- __DIR__.'/../../lang' => resource_path('lang/vendor/laravel-generator'),
- ], 'lang');
+ // Publish assets
+ $this->registerAssetPublishing();
}
/**
@@ -58,10 +42,6 @@ public function register(): void
{
$configPath = __DIR__.'/../../config/laravel-generator.php';
$this->mergeConfigFrom($configPath, 'laravel-generator');
-
- $this->app->singleton('laravel-generator', function () {
- return new ConfigHelper();
- });
}
/**
@@ -73,4 +53,23 @@ public function provides(): ?array
{
return ['laravel-generator'];
}
+
+ /**
+ * @return void
+ */
+ protected function registerAssetPublishing(): void
+ {
+ $configPath = __DIR__.'/../../config/laravel-generator.php';
+ $this->publishes([
+ $configPath => config_path('laravel-generator.php'),
+ ], 'config');
+
+ $this->publishes([
+ __DIR__.'/../../resources/views' => config('laravel-generator.defaults.paths.views'),
+ ], 'views');
+
+ $this->publishes([
+ __DIR__.'/../../lang' => resource_path('lang/vendor/laravel-generator'),
+ ], 'lang');
+ }
}
diff --git a/tests/Unit/DetectTest.php b/tests/Unit/DetectTest.php
index 509840e..a58fc25 100644
--- a/tests/Unit/DetectTest.php
+++ b/tests/Unit/DetectTest.php
@@ -1,8 +1,8 @@