Updates for addon/modules to make it easier to create APIs
This commit is contained in:
7
modules/Sample/Http/Routes/admin.php
Normal file
7
modules/Sample/Http/Routes/admin.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
# This is the admin path. Comment this out if you don't have
|
||||
# an admin panel component.
|
||||
Route::group([], function () {
|
||||
Route::get('/', 'AdminController@index');
|
||||
});
|
||||
17
modules/Sample/Http/Routes/api.php
Normal file
17
modules/Sample/Http/Routes/api.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This is publicly accessible
|
||||
*/
|
||||
Route::group(['middleware' => []], function() {
|
||||
Route::get('/', 'SampleController@index');
|
||||
});
|
||||
|
||||
/**
|
||||
* This is required to have a valid API key
|
||||
*/
|
||||
Route::group(['middleware' => [
|
||||
'api.auth'
|
||||
]], function() {
|
||||
Route::get('/hello', 'SampleController@hello');
|
||||
});
|
||||
9
modules/Sample/Http/Routes/web.php
Normal file
9
modules/Sample/Http/Routes/web.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
Route::group(['middleware' => [
|
||||
'role:user' # leave blank to make this public
|
||||
]], function() {
|
||||
# all your routes are prefixed with the above prefix
|
||||
# e.g. yoursite.com/sample
|
||||
Route::get('/', 'SampleController@index');
|
||||
});
|
||||
Reference in New Issue
Block a user