-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove route macro's and use twillRoutes facade.
- Loading branch information
1 parent
289e858
commit 42987e4
Showing
22 changed files
with
151 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
# Routes | ||
|
||
A router macro is available to create module routes quicker: | ||
A router facade is available to create module routes quicker: | ||
```php | ||
<?php | ||
|
||
Route::module('yourModulePluralName'); | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
TwillRoutes::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::module('yourModulePluralName', ['except' => ['reorder', 'feature', 'bucket', 'browser']]); | ||
TwillRoutes::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::module('yourModulePluralName', [], ['only' => ['index', 'edit', 'store', 'destroy']]); | ||
TwillRoutes::module('yourModulePluralName', [], ['only' => ['index', 'edit', 'store', 'destroy']]); | ||
|
||
// The last optional parameter disable the resource controller actions on the module | ||
Route::module('yourPluralModuleName', [], [], false); | ||
TwillRoutes::module('yourPluralModuleName', [], [], false); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
// Register Twill routes here eg. | ||
// Route::module('posts'); | ||
|
||
Route::module('pages'); | ||
Route::module('menuLinks'); | ||
Route::module('menuLinks'); | ||
TwillRoutes::module('pages'); | ||
TwillRoutes::module('menuLinks'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
Route::module('projects'); | ||
Route::module('partners'); | ||
Route::module('comments'); | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
TwillRoutes::module('projects'); | ||
TwillRoutes::module('partners'); | ||
TwillRoutes::module('comments'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
// Register Twill routes here eg. | ||
|
||
Route::module('writers'); | ||
Route::module('letters'); | ||
Route::module('bios'); | ||
Route::module('books'); | ||
TwillRoutes::module('writers'); | ||
TwillRoutes::module('letters'); | ||
TwillRoutes::module('bios'); | ||
TwillRoutes::module('books'); |
4 changes: 3 additions & 1 deletion
4
examples/tests-capsules/app/Twill/Capsules/Posts/routes/twill.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?php | ||
|
||
Route::module('posts'); | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
TwillRoutes::module('posts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<?php | ||
|
||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
Route::group(['prefix' => 'personnel'], function () { | ||
Route::module('authors'); | ||
TwillRoutes::module('authors'); | ||
}); | ||
|
||
Route::module('categories'); | ||
TwillRoutes::module('categories'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
Route::module('nodes'); | ||
TwillRoutes::module('nodes'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?php | ||
|
||
Route::module('postings'); | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
TwillRoutes::module('postings'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
Route::singleton('contactPage'); | ||
TwillRoutes::singleton('contactPage'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
// Register Twill routes here eg. | ||
// Route::module('posts'); | ||
|
||
Route::module('pages'); | ||
TwillRoutes::module('pages'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
// Register Twill routes here eg. | ||
// Route::module('posts'); | ||
// TwillRoutes::module('posts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?php | ||
|
||
Route::module('{{moduleName}}'); | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
TwillRoutes::module('{{moduleName}}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?php | ||
|
||
Route::singleton('{{moduleName}}'); | ||
use A17\Twill\Facades\TwillRoutes; | ||
|
||
TwillRoutes::singleton('{{moduleName}}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.