Skip to content

Dev master #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: dev-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/node_modules
/public/hot
/public/storage
/public/mix-manifest.json
/storage/*.key
/vendor
/.idea
Expand All @@ -10,3 +11,4 @@ Homestead.yaml
npm-debug.log
yarn-error.log
.env
.php_cs.cache
Empty file added Modules/Core/Assets/.gitkeep
Empty file.
81 changes: 81 additions & 0 deletions Modules/Core/Assets/js/Admin.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template>
<div class="admin">
<el-row>
<el-col :span="24">
<div class="grid-header">Protavel Admin 头部导航栏</div>
</el-col>
</el-row>
<el-row style="height: 100%">
<el-col :span="4" class="grid-sider">
<div>
<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
<el-submenu index="1">
<template slot="title"><i class="el-icon-message"></i>导航一</template>
<el-menu-item-group>
<template slot="title">分组一</template>
<el-menu-item index="1-1">选项1</el-menu-item>
<el-menu-item index="1-2">选项2</el-menu-item>
</el-menu-item-group>
<el-menu-item-group title="分组2">
<el-menu-item index="1-3">选项3</el-menu-item>
</el-menu-item-group>
<el-submenu index="1-4">
<template slot="title">选项4</template>
<el-menu-item index="1-4-1">选项1</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item index="2"><i class="el-icon-menu"></i>导航二</el-menu-item>
<el-menu-item index="3"><i class="el-icon-setting"></i>导航三</el-menu-item>
</el-menu>
</div>
</el-col>
<el-col :span="20" class="grid-content">
<div>内容</div>
</el-col>
</el-row>
</div>
</template>

<script>
export default {
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath);
},
handleClose(key, keyPath) {
console.log(key, keyPath);
}
}
}
</script>

<style>
body, html {
height: 100vh;
}

.admin {
height: 100%;
}

.grid-header {
width: 100%;
height: 30px;
text-align: center;
background-color: #99a9bf;
}

.grid-sider {
height: 100%;
background-color: #eef1f6;
}

.grid-content {
height: 100%;
background-color: #e5e9f2;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
21 changes: 21 additions & 0 deletions Modules/Core/Assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/

require('./bootstrap');

window.Vue = require('vue');
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-default/index.css';

import Admin from './Admin.vue';

Vue.use(ElementUI);

const app = new Vue({
el: '#admin',
render: h => h(Admin)
});
53 changes: 53 additions & 0 deletions Modules/Core/Assets/js/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

window._ = require('lodash');

/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/

try {
window.$ = window.jQuery = require('jquery');

require('bootstrap-sass');
} catch (e) {}

/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/

window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/

// import Echo from 'laravel-echo'

// window.Pusher = require('pusher-js');

// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: 'your-pusher-key'
// });
Empty file added Modules/Core/Config/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions Modules/Core/Config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'name' => 'Core'
];
Empty file added Modules/Core/Console/.gitkeep
Empty file.
Empty file.
Empty file.
21 changes: 21 additions & 0 deletions Modules/Core/Database/Seeders/CoreDatabaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Modules\Core\Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class CoreDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();

// $this->call("OthersTableSeeder");
}
}
Empty file added Modules/Core/Emails/.gitkeep
Empty file.
Empty file added Modules/Core/Entities/.gitkeep
Empty file.
Empty file added Modules/Core/Events/.gitkeep
Empty file.
Empty file.
72 changes: 72 additions & 0 deletions Modules/Core/Http/Controllers/CoreController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Modules\Core\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;

class CoreController extends Controller
{
/**
* Display a listing of the resource.
* @return Response
*/
public function index()
{
return view('core::index');
}

/**
* Show the form for creating a new resource.
* @return Response
*/
public function create()
{
return view('core::create');
}

/**
* Store a newly created resource in storage.
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
}

/**
* Show the specified resource.
* @return Response
*/
public function show()
{
return view('core::show');
}

/**
* Show the form for editing the specified resource.
* @return Response
*/
public function edit()
{
return view('core::edit');
}

/**
* Update the specified resource in storage.
* @param Request $request
* @return Response
*/
public function update(Request $request)
{
}

/**
* Remove the specified resource from storage.
* @return Response
*/
public function destroy()
{
}
}
Empty file.
Empty file.
5 changes: 5 additions & 0 deletions Modules/Core/Http/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

Route::group(['middleware' => 'web', 'prefix' => 'admin', 'namespace' => 'Modules\Core\Http\Controllers'], function () {
Route::get('/', 'CoreController@index');
});
Empty file added Modules/Core/Jobs/.gitkeep
Empty file.
Empty file added Modules/Core/Listeners/.gitkeep
Empty file.
Empty file.
Empty file added Modules/Core/Providers/.gitkeep
Empty file.
112 changes: 112 additions & 0 deletions Modules/Core/Providers/CoreServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php

namespace Modules\Core\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;

class CoreServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->registerFactories();
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}

/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
__DIR__.'/../Config/config.php' => config_path('core.php'),
], 'config');
$this->mergeConfigFrom(
__DIR__.'/../Config/config.php', 'core'
);
}

/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/core');

$sourcePath = __DIR__.'/../Resources/views';

$this->publishes([
$sourcePath => $viewPath
]);

$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/core';
}, \Config::get('view.paths')), [$sourcePath]), 'core');
}

/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/core');

if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'core');
} else {
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'core');
}
}

/**
* Register an additional directory of factories.
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
*/
public function registerFactories()
{
if (! app()->environment('production')) {
app(Factory::class)->load(__DIR__ . '/../Database/factories');
}
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}
Empty file.
Empty file.
Empty file.
Loading