Skip to content

Commit

Permalink
Merge pull request #1962 from area17/fix-laravel-9-compatibility
Browse files Browse the repository at this point in the history
Fix laravel 9 compatibility
  • Loading branch information
haringsrob authored Nov 30, 2022
2 parents ccf5d27 + f05324f commit 2b5505a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/crud-modules/cli-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Add the route to your admin routes file(`routes/admin.php`).
```php
<?php

Route::singleton('moduleName');
Route::twillSingleton('moduleName');
```

Setup a new CMS navigation item in `config/twill-navigation.php`.
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ModuleMake.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public function handle()
} elseif ($this->isSingleton) {
$this->createSingletonSeed($modelName);
$this->info("\nAdd to routes/admin.php:\n");
$this->info(" Route::singleton('{$singularModuleName}');\n");
$this->info(" Route::twillSingleton('{$singularModuleName}');\n");
} else {
$this->info("\nAdd to routes/admin.php:\n");
$this->info(" Route::module('{$moduleName}');\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/stubs/routes_singleton_admin.stub
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

Route::singleton('{{moduleName}}');
Route::twillSingleton('{{moduleName}}');
2 changes: 1 addition & 1 deletion src/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function () use ($slug, $className, $resource_options) {
}
});

Route::macro('singleton', function (
Route::macro('twillSingleton', function (
$slug,
$options = [],
$resource_options = [],
Expand Down
2 changes: 1 addition & 1 deletion tests/stubs/singleton/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

use Illuminate\Support\Facades\Route;

Route::singleton('contactPage');
Route::twillSingleton('contactPage');

0 comments on commit 2b5505a

Please sign in to comment.