完成登入畫面製作、路由調整及新增receiver控制器

This commit is contained in:
Tom K.H. Lin 2018-07-29 17:25:36 +08:00
parent 848226bbb3
commit 0d51e9db6b
10 changed files with 148 additions and 13 deletions

42
app/Admin.php Normal file
View File

@ -0,0 +1,42 @@
<?php
/**
* Created by Reliese Model.
* Date: Sun, 29 Jul 2018 08:54:26 +0000.
*/
namespace App;
use Illuminate\Database\Eloquent\Model as Eloquent;
/**
* Class Admin
*
* @property string $ID
* @property string $password
* @property string $name
* @property string $nick_name
* @property string $phone_number
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*
* @package App
*/
class Admin extends Eloquent
{
protected $connection = 'mysql';
protected $table = 'admin';
protected $primaryKey = 'ID';
public $incrementing = false;
protected $hidden = [
'password'
];
protected $fillable = [
'password',
'name',
'nick_name',
'phone_number'
];
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ReceiverController extends Controller
{
public function login()
{
return view('receiver.login');
}
}

View File

@ -3,6 +3,7 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
// Schema::defaultStringLength(191);
} }
/** /**

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAdminTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('admin', function (Blueprint $table) {
$table->string('ID');
$table->string('password');
$table->string('name');
$table->string('nick_name');
$table->string('phone_number');
$table->primary('ID');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('admin');
}
}

View File

@ -11,6 +11,6 @@ class DatabaseSeeder extends Seeder
*/ */
public function run() public function run()
{ {
// $this->call(UsersTableSeeder::class);
} }
} }

View File

@ -1,5 +1,7 @@
@extends('layout.app') @extends('layout.app')
@section('title','部落客媒合系統')
@section('content') @section('content')
<button class="btn btn-primary">我想成為KOL</button> <button class="btn btn-primary">我想成為KOL</button>
<button class="btn btn-primary">我想成為品牌/代理商</button> <button class="btn btn-primary">我想成為品牌/代理商</button>

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>部落客媒合系統</title> <title>@yield('title')</title>
<link rel="stylesheet" href="/css/app.css"> <link rel="stylesheet" href="/css/app.css">
</head> </head>
<body> <body>
@ -14,11 +14,10 @@
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto"> <ul class="navbar-nav ml-auto">
<li class="nav-item active"> <li class="nav-item active">
<a class="nav-link" href="#">KOL登入<span class="sr-only">(current)</span></a> <a class="nav-link" href="/receiver/login">KOL登入<span class="sr-only">(current)</span></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#">品牌/代理商登入</a> <a class="nav-link" href="#">品牌/代理商登入</a>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>@yield('title')</title>
<link rel="stylesheet" href="/css/app.css">
</head>
<body>
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">部落客媒合系統</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
<div class="mt-3">
@yield('content')
</div>
</div>
<script src="/js/app.js"></script>
</body>
</html>

View File

@ -0,0 +1,18 @@
@extends('layout.login')
@section('title','KOL登入')
@section('content')
<form action="" method="POST">
<div class="form-group">
<label for="InputEmail1">帳號</label>
<input type="email" name="ID" class="form-control" id="InputEmail1" aria-describedby="emailHelp" placeholder="請輸入電子郵件地址">
</div>
<div class="form-group">
<label for="InputPassword1">密碼</label>
<input type="password" name="password" class="form-control" id="InputPassword1" placeholder="請輸入密碼">
</div>
<button type="submit" class="btn btn-primary btn-lg">登入</button>
<input type="button" class="btn btn-default btn-lg" value="取消">
</form>
@endsection

View File

@ -25,13 +25,13 @@ Route::get('/', 'HomeController@index');
// Route::get('/dashbord', ''); // Route::get('/dashbord', '');
// }); // });
// //
// //接案者相關url //接案者相關url
// Route::group(['prefix' => 'receiver'], function () { Route::group(['prefix' => 'receiver'], function () {
// Route::get('/login', ''); Route::get('/login', 'ReceiverController@login');
//Route::post('/login', ''); //Route::post('/login', '');
// Route::get('/register', ''); // Route::get('/register', '');
// Route::post('/register', ''); // Route::post('/register', '');
// }); });
// //
// //發案者相關url // //發案者相關url
// Route::group(['prefix' => 'casebuilder'], function () { // Route::group(['prefix' => 'casebuilder'], function () {