Skip to content

Commit

Permalink
Rename only singleton.
Browse files Browse the repository at this point in the history
  • Loading branch information
haringsrob committed Nov 30, 2022
1 parent ead1205 commit 6498846
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 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 @@ -27,7 +27,7 @@ Add the route to your admin routes file(`routes/admin.php`).
```php
<?php

Route::twillModule('moduleName');
Route::module('moduleName');
```

Setup a new CMS navigation item in `config/twill-navigation.php`.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/crud-modules/nested-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ class IssueController extends BaseModuleController
Add both modules to `routes/admin.php`:

```php
Route::twillModule('issues');
Route::twillModule('issues.articles');
Route::module('issues');
Route::module('issues.articles');
```

Add the parent module to `config/twill-navigation.php`:
Expand Down
8 changes: 4 additions & 4 deletions docs/src/crud-modules/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ A router macro is available to create module routes quicker:
```php
<?php

Route::twillModule('yourModulePluralName');
Route::module('yourModulePluralName');

// You can add an array of only/except action names as a second parameter
// By default, the following routes are created : 'reorder', 'publish', 'browser', 'bucket', 'feature', 'restore', 'bulkFeature', 'bulkPublish', 'bulkDelete', 'bulkRestore'
Route::twillModule('yourModulePluralName', ['except' => ['reorder', 'feature', 'bucket', 'browser']]);
Route::module('yourModulePluralName', ['except' => ['reorder', 'feature', 'bucket', 'browser']]);

// You can add an array of only/except action names for the resource controller as a third parameter
// By default, the following routes are created : 'index', 'store', 'show', 'edit', 'update', 'destroy'
Route::twillModule('yourModulePluralName', [], ['only' => ['index', 'edit', 'store', 'destroy']]);
Route::module('yourModulePluralName', [], ['only' => ['index', 'edit', 'store', 'destroy']]);

// The last optional parameter disable the resource controller actions on the module
Route::twillModule('yourPluralModuleName', [], [], false);
Route::module('yourPluralModuleName', [], [], false);
```
12 changes: 6 additions & 6 deletions docs/src/getting-started/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ To make it work properly and to get active states automatically in Twill's UI, y
```php
<?php

Route::twillModule('pages');
Route::module('pages');

Route::group(['prefix' => 'work'], function () {
Route::group(['prefix' => 'projects'], function () {
Route::twillModule('projectCustomers');
Route::module('projectCustomers');
});
Route::twillModule('projects');
Route::twillModule('clients');
Route::twillModule('industries');
Route::twillModule('studios');
Route::module('projects');
Route::module('clients');
Route::module('industries');
Route::module('studios');
});
```
8 changes: 4 additions & 4 deletions docs/src/guides/adding-custom-roles-and-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Add the modules to our admin routes:
```php
// update file: routes/admin.php

Route::twillModule('pages');
Route::module('pages');

Route::twillModule('posts');
Route::module('posts');
```

... and to our navigation:
Expand Down Expand Up @@ -246,11 +246,11 @@ Then, add the route groups and middleware in the admin routes configuration:

```php
Route::group(['middleware' => 'can:edit-pages'], function () {
Route::twillModule('pages');
Route::module('pages');
});

Route::group(['middleware' => 'can:edit-posts'], function () {
Route::twillModule('posts');
Route::module('posts');
});

// ...
Expand Down
2 changes: 1 addition & 1 deletion routes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Support\Facades\Route;

if (config('twill.enabled.users-management')) {
Route::twillModule('users', ['except' => ['sort', 'feature']]);
Route::module('users', ['except' => ['sort', 'feature']]);
}

if (config('twill.enabled.media-library')) {
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ModuleMake.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function handle()
$this->info(" Route::twillSingleton('{$singularModuleName}');\n");
} else {
$this->info("\nAdd to routes/admin.php:\n");
$this->info(" Route::twillModule('{$moduleName}');\n");
$this->info(" Route::module('{$moduleName}');\n");
}

$navModuleName = $this->isSingleton ? $singularModuleName : $moduleName;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/stubs/admin.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
use Illuminate\Support\Facades\Route;

// Register Twill routes here eg.
// Route::twillModule('posts');
// Route::module('posts');
2 changes: 1 addition & 1 deletion src/Commands/stubs/routes_admin.stub
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

Route::twillModule('{{moduleName}}');
Route::module('{{moduleName}}');
2 changes: 1 addition & 1 deletion src/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function () use ($slug, $className, $resource_options) {
$pluralSlug = Str::plural($slug);
$modelName = Str::studly($slug);

Route::twillModule($pluralSlug, $options, $resource_options, $resource);
Route::module($pluralSlug, $options, $resource_options, $resource);

$lastRouteGroupName = RouteServiceProvider::getLastRouteGroupName();

Expand Down
8 changes: 4 additions & 4 deletions tests/stubs/browsers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Register Twill routes here eg.

Route::twillModule('writers');
Route::twillModule('letters');
Route::twillModule('bios');
Route::twillModule('books');
Route::module('writers');
Route::module('letters');
Route::module('bios');
Route::module('books');
2 changes: 1 addition & 1 deletion tests/stubs/capsules/posts/routes/admin.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

Route::twillModule('posts');
Route::module('posts');
4 changes: 2 additions & 2 deletions tests/stubs/modules/authors/admin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

Route::group(['prefix' => 'personnel'], function () {
Route::twillModule('authors');
Route::module('authors');
});

Route::twillModule('categories');
Route::module('categories');
2 changes: 1 addition & 1 deletion tests/stubs/nested_module/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

use Illuminate\Support\Facades\Route;

Route::twillModule('nodes');
Route::module('nodes');

0 comments on commit 6498846

Please sign in to comment.