Fix the module stubs and sample module for admin closes #201
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\Sample\Http\Controllers;
|
namespace Modules\Sample\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|||||||
@@ -4,4 +4,5 @@
|
|||||||
# an admin panel component.
|
# an admin panel component.
|
||||||
Route::group([], function () {
|
Route::group([], function () {
|
||||||
Route::get('/', 'AdminController@index');
|
Route::get('/', 'AdminController@index');
|
||||||
|
Route::get('/create', 'AdminController@create');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class SampleServiceProvider extends ServiceProvider
|
|||||||
// $this->moduleSvc->addFrontendLink('Sample', '/sample', '', $logged_in=true);
|
// $this->moduleSvc->addFrontendLink('Sample', '/sample', '', $logged_in=true);
|
||||||
|
|
||||||
// Admin links:
|
// Admin links:
|
||||||
$this->moduleSvc->addAdminLink('Sample', '/sample/admin');
|
$this->moduleSvc->addAdminLink('Sample', '/admin/sample');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +73,7 @@ class SampleServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
Route::group([
|
Route::group([
|
||||||
'as' => 'sample.',
|
'as' => 'sample.',
|
||||||
'prefix' => 'api/sample/admin',
|
'prefix' => 'admin/sample',
|
||||||
// If you want a RESTful module, change this to 'api'
|
// If you want a RESTful module, change this to 'api'
|
||||||
'middleware' => ['web', 'role:admin'],
|
'middleware' => ['web', 'role:admin'],
|
||||||
'namespace' => 'Modules\Sample\Http\Controllers\Admin'
|
'namespace' => 'Modules\Sample\Http\Controllers\Admin'
|
||||||
|
|||||||
14
modules/Sample/Resources/views/admin/create.blade.php
Normal file
14
modules/Sample/Resources/views/admin/create.blade.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@extends('sample::layouts.admin')
|
||||||
|
|
||||||
|
@section('title', 'Sample Create')
|
||||||
|
@section('actions')
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="card border-blue-bottom">
|
||||||
|
<div class="content">
|
||||||
|
<div class="header"><h4 class="title">Create something!</h4></div>
|
||||||
|
<p>Add a form!</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -3,15 +3,15 @@
|
|||||||
@section('title', 'Sample')
|
@section('title', 'Sample')
|
||||||
@section('actions')
|
@section('actions')
|
||||||
<li>
|
<li>
|
||||||
<a href="{!! url('/sample/admin/create') !!}">
|
<a href="{!! url('/admin/sample/create') !!}">
|
||||||
<i class="ti-plus"></i>
|
<i class="ti-plus"></i>
|
||||||
Add New</a>
|
Add New</a>
|
||||||
</li>
|
</li>
|
||||||
@endsection
|
@endsection
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="card border-blue-bottom">
|
<div class="card border-blue-bottom">
|
||||||
<div class="header"><h4 class="title">Admin Scaffold!</h4></div>
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<div class="header"><h4 class="title">Admin Scaffold!</h4></div>
|
||||||
<p>This view is loaded from module: {!! config('sample.name') !!}</p>
|
<p>This view is loaded from module: {!! config('sample.name') !!}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace $MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers;
|
namespace $MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
# This is the admin path. Comment this out if you don't have
|
# This is the admin path. Comment this out if you don't have an admin panel component.
|
||||||
# an admin panel component.
|
|
||||||
Route::group([], function () {
|
Route::group([], function () {
|
||||||
Route::get('/', 'AdminController@index');
|
Route::get('/', 'AdminController@index');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class $CLASS$ extends ServiceProvider
|
|||||||
// $this->moduleSvc->addFrontendLink('$STUDLY_NAME$', '/$LOWER_NAME$', '', $logged_in=true);
|
// $this->moduleSvc->addFrontendLink('$STUDLY_NAME$', '/$LOWER_NAME$', '', $logged_in=true);
|
||||||
|
|
||||||
// Admin links:
|
// Admin links:
|
||||||
$this->moduleSvc->addAdminLink('$STUDLY_NAME$', '/$LOWER_NAME$/admin');
|
$this->moduleSvc->addAdminLink('$STUDLY_NAME$', '/admin/$LOWER_NAME$');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +73,7 @@ class $CLASS$ extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
Route::group([
|
Route::group([
|
||||||
'as' => '$LOWER_NAME$.',
|
'as' => '$LOWER_NAME$.',
|
||||||
'prefix' => 'api/$LOWER_NAME$/admin',
|
'prefix' => 'admin/$LOWER_NAME$',
|
||||||
// If you want a RESTful module, change this to 'api'
|
// If you want a RESTful module, change this to 'api'
|
||||||
'middleware' => ['web', 'role:admin'],
|
'middleware' => ['web', 'role:admin'],
|
||||||
'namespace' => '$MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers\Admin'
|
'namespace' => '$MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers\Admin'
|
||||||
|
|||||||
Reference in New Issue
Block a user