Sample module
This commit is contained in:
63
modules/Sample/Http/Controllers/AdminController.php
Normal file
63
modules/Sample/Http/Controllers/AdminController.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Sample\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class AdminController extends AppBaseController
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('sample::admin.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('sample::admin.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
return view('sample::admin.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
return view('sample::admin.edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy()
|
||||
{
|
||||
}
|
||||
}
|
||||
64
modules/Sample/Http/Controllers/SampleController.php
Normal file
64
modules/Sample/Http/Controllers/SampleController.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Sample\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class SampleController extends AppBaseController
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('sample::index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('sample::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
return view('sample::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
return view('sample::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy()
|
||||
{
|
||||
}
|
||||
}
|
||||
24
modules/Sample/Http/routes.php
Normal file
24
modules/Sample/Http/routes.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
Route::group([
|
||||
'as' => 'sample.',
|
||||
'prefix' => 'sample',
|
||||
'middleware' => [
|
||||
'web',
|
||||
'role:admin|user' # leave blank for public
|
||||
],
|
||||
'namespace' => 'Modules\Sample\Http\Controllers'
|
||||
], function() {
|
||||
|
||||
# all your routes are prefixed with the above prefix
|
||||
# e.g. yoursite.com/sample
|
||||
Route::get('/', 'SampleController@index');
|
||||
|
||||
# This is the admin path. Comment this out if you don't have
|
||||
# an admin panel component.
|
||||
Route::group([
|
||||
'middleware' => ['role:admin'],
|
||||
], function () {
|
||||
Route::get('/admin', 'AdminController@index');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user