diff --git a/composer.json b/composer.json index e9e5670..a1eb721 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ } }, "require": { - "php": ">=7.0", - "illuminate/support": "5.4.* || 5.5.*", + "php": ">=5.6.4", + "illuminate/support": "5.3.* || 5.4.* || 5.5.*", "laravel/browser-kit-testing": "^2.0" }, "require-dev": { diff --git a/src/stubs/route-web.stub b/src/stubs/route-web.stub index edd9fd5..a14f14b 100644 --- a/src/stubs/route-web.stub +++ b/src/stubs/route-web.stub @@ -1,2 +1,2 @@ -Route::apiResource('masters', 'MastersController'); +Route::resource('masters', 'MastersController'); diff --git a/src/stubs/view-index.stub b/src/stubs/view-index.stub index 8b66687..ff31c1a 100644 --- a/src/stubs/view-index.stub +++ b/src/stubs/view-index.stub @@ -57,7 +57,9 @@
- @includeWhen(Request::has('action'), 'masters.forms') + @if(Request::has('action')) + @include('masters.forms') + @endif
@endsection diff --git a/tests/Generators/RouteWebGeneratorTest.php b/tests/Generators/RouteWebGeneratorTest.php index 446eddf..33ce545 100644 --- a/tests/Generators/RouteWebGeneratorTest.php +++ b/tests/Generators/RouteWebGeneratorTest.php @@ -15,7 +15,7 @@ class RouteWebGeneratorTest extends TestCase $this->assertFileExists($routeWebPath); $routeWebFileContent = "table_name}', '{$this->plural_model_name}Controller'); +Route::resource('{$this->table_name}', '{$this->plural_model_name}Controller'); "; $this->assertEquals($routeWebFileContent, file_get_contents($routeWebPath)); } @@ -29,7 +29,7 @@ Route::apiResource('{$this->table_name}', '{$this->plural_model_name}Controller' $this->assertFileExists($routeWebPath); $routeWebFileContent = "table_name}', 'Projects\\{$this->plural_model_name}Controller'); +Route::resource('{$this->table_name}', 'Projects\\{$this->plural_model_name}Controller'); "; $this->assertEquals($routeWebFileContent, file_get_contents($routeWebPath)); } diff --git a/tests/Generators/ViewsGeneratorTest.php b/tests/Generators/ViewsGeneratorTest.php index 5ba6ec6..a972d48 100644 --- a/tests/Generators/ViewsGeneratorTest.php +++ b/tests/Generators/ViewsGeneratorTest.php @@ -73,7 +73,9 @@ class ViewsGeneratorTest extends TestCase
- @includeWhen(Request::has('action'), '{$this->table_name}.forms') + @if(Request::has('action')) + @include('{$this->table_name}.forms') + @endif
@endsection @@ -162,7 +164,7 @@ class ViewsGeneratorTest extends TestCase public function generateDefaultLayoutView($defaultLayoutView) { $dataViewPathArray = explode('.', $defaultLayoutView); - $fileName = array_pop($dataViewPathArray); + $fileName = array_pop($dataViewPathArray); $defaultLayoutPath = resource_path('views/'.implode('/', $dataViewPathArray)); $files = app('Illuminate\Filesystem\Filesystem');