Skip to content

Commit

Permalink
merge branch wuxuehai
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoQingSong committed Jun 5, 2016
2 parents 5d5c8da + 27efd0d commit 63ea047
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 65 deletions.
19 changes: 19 additions & 0 deletions app/Http/Controllers/Admin/LoginController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/** +----------------------------------------------------------------------
* | KeepMoving
* +----------------------------------------------------------------------
* | Date : 16/6/5 下午4:08
* +----------------------------------------------------------------------
* | Author: WuXueHai '<367052992@qq.com>'
* +----------------------------------------------------------------------*/

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;

class LoginController extends Controller
{
public function login(){
return View('Admin.login');
}
}
6 changes: 6 additions & 0 deletions app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@
Route::get('/', function () {
return view('welcome');
});


Route::get('/admin/', 'Admin\MainController@index');
Route::get('/admin/login', 'Admin\LoginController@login');


12 changes: 12 additions & 0 deletions app/Models/Admin/Administrator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/** +----------------------------------------------------------------------
* | KeepMoving
* +----------------------------------------------------------------------
* | Date : 16/6/5 下午3:57
* +----------------------------------------------------------------------
* | Author: WuXueHai '<367052992@qq.com>'
* +----------------------------------------------------------------------*/

namespace App\Models\Admin;

class Admin
8 changes: 8 additions & 0 deletions app/Models/Admin/RBAC/Permission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/** +----------------------------------------------------------------------
* | KeepMoving
* +----------------------------------------------------------------------
* | Date : 16/6/5 下午3:49
* +----------------------------------------------------------------------
* | Author: WuXueHai '<367052992@qq.com>'
* +----------------------------------------------------------------------*/
17 changes: 17 additions & 0 deletions app/Models/Admin/RBAC/Role.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/** +----------------------------------------------------------------------
* | KeepMoving
* +----------------------------------------------------------------------
* | Date : 16/6/5 下午3:45
* +----------------------------------------------------------------------
* | Author: WuXueHai '<367052992@qq.com>'
* +----------------------------------------------------------------------*/

namespace App\Models\Admin;

use Zizaco\Entrust\EntrustRole;

class Role extends EntrustRole
{

}
34 changes: 0 additions & 34 deletions database/migrations/2014_10_12_000000_create_users_table.php

This file was deleted.

This file was deleted.

71 changes: 71 additions & 0 deletions database/migrations/2016_06_05_073918_entrust_setup_tables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class EntrustSetupTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Create table for storing roles
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
$table->timestamps();
});

// Create table for associating roles to users (Many-to-Many)
Schema::create('role_user', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('role_id')->unsigned();

/*$table->foreign('user_id')->references('id')->on('')
->onUpdate('cascade')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')
->onUpdate('cascade')->onDelete('cascade');*/

$table->primary(['user_id', 'role_id']);
});

// Create table for storing permissions
Schema::create('permissions', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
$table->timestamps();
});

// Create table for associating permissions to roles (Many-to-Many)
Schema::create('permission_role', function (Blueprint $table) {
$table->integer('permission_id')->unsigned();
$table->integer('role_id')->unsigned();

$table->foreign('permission_id')->references('id')->on('permissions')
->onUpdate('cascade')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')
->onUpdate('cascade')->onDelete('cascade');

$table->primary(['permission_id', 'role_id']);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('permission_role');
Schema::drop('permissions');
Schema::drop('role_user');
Schema::drop('roles');
}
}
11 changes: 11 additions & 0 deletions resources/views/Admin/login.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/** +----------------------------------------------------------------------
* | KeepMoving
* +----------------------------------------------------------------------
* | Date : 16/6/5 下午4:13
* +----------------------------------------------------------------------
* | Author: WuXueHai '<367052992@qq.com>'
* +----------------------------------------------------------------------*/
echo 111;

0 comments on commit 63ea047

Please sign in to comment.