forked from kol/BlogMatch
Compare commits
11 Commits
ddde0e25d1
...
62ce1f2068
Author | SHA1 | Date | |
---|---|---|---|
62ce1f2068 | |||
f682741758 | |||
9fd6e08400 | |||
a130550274 | |||
7d48d74cb1 | |||
e8b92eb473 | |||
21f7367b7e | |||
36fecb5d9e | |||
a52429930e | |||
9216e2f157 | |||
4b9b4f1880 |
@ -18,7 +18,9 @@ class LoginController extends Controller
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use AuthenticatesUsers;
|
use AuthenticatesUsers{
|
||||||
|
showLoginForm as traitShowLoginForm;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Where to redirect users after login.
|
* Where to redirect users after login.
|
||||||
@ -36,4 +38,47 @@ class LoginController extends Controller
|
|||||||
{
|
{
|
||||||
$this->middleware('guest')->except('logout');
|
$this->middleware('guest')->except('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the application's login form.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function showLoginForm()
|
||||||
|
{
|
||||||
|
// return view('auth.login');
|
||||||
|
// return $this->traitShowLoginForm();
|
||||||
|
return view('auth.login');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顯示接案者的登入表單
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function showReceiverLoginForm()
|
||||||
|
{
|
||||||
|
return $this->showLoginForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顯示發案者的登入表單
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function showCaseBuilderLoginForm()
|
||||||
|
{
|
||||||
|
return $this->showLoginForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顯示網站管理者的登入表單
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function showAdminLoginForm()
|
||||||
|
{
|
||||||
|
return $this->showLoginForm();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'defaults' => [
|
'defaults' => [
|
||||||
'guard' => 'web',
|
'guard' => 'receivers-web',
|
||||||
'passwords' => 'users',
|
'passwords' => 'receivers',
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -36,15 +36,42 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'guards' => [
|
'guards' => [
|
||||||
'web' => [
|
// 'web' => [
|
||||||
|
// 'driver' => 'session',
|
||||||
|
// 'provider' => 'users',
|
||||||
|
// ],
|
||||||
|
// 'api' => [
|
||||||
|
// 'driver' => 'token',
|
||||||
|
// 'provider' => 'users',
|
||||||
|
// ],
|
||||||
|
|
||||||
|
'receivers-web' => [
|
||||||
'driver' => 'session',
|
'driver' => 'session',
|
||||||
'provider' => 'users',
|
'provider' => 'receivers',
|
||||||
|
],
|
||||||
|
'receivers-api' => [
|
||||||
|
'driver' => 'token',
|
||||||
|
'provider' => 'receivers',
|
||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'caseBuilders-web' => [
|
||||||
'driver' => 'token',
|
'driver' => 'session',
|
||||||
'provider' => 'users',
|
'provider' => 'caseBuilders',
|
||||||
],
|
],
|
||||||
|
'caseBuilders-api' => [
|
||||||
|
'driver' => 'token',
|
||||||
|
'provider' => 'caseBuilders',
|
||||||
|
],
|
||||||
|
|
||||||
|
'admins-web' => [
|
||||||
|
'driver' => 'session',
|
||||||
|
'provider' => 'admins',
|
||||||
|
],
|
||||||
|
// 'admins-api' => [
|
||||||
|
// 'driver' => 'token',
|
||||||
|
// 'provider' => 'admins',
|
||||||
|
// ],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -65,9 +92,21 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'providers' => [
|
'providers' => [
|
||||||
'users' => [
|
// 'users' => [
|
||||||
|
// 'driver' => 'eloquent',
|
||||||
|
// 'model' => App\User::class,
|
||||||
|
// ],
|
||||||
|
'receivers' => [
|
||||||
'driver' => 'eloquent',
|
'driver' => 'eloquent',
|
||||||
'model' => App\User::class,
|
'model' => App\Receiver::class,
|
||||||
|
],
|
||||||
|
'caseBuilders' => [
|
||||||
|
'driver' => 'eloquent',
|
||||||
|
'model' => App\CaseBuilder::class,
|
||||||
|
],
|
||||||
|
'admins' => [
|
||||||
|
'driver' => 'eloquent',
|
||||||
|
'model' => App\Admin::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
// 'users' => [
|
// 'users' => [
|
||||||
@ -92,11 +131,21 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'passwords' => [
|
'passwords' => [
|
||||||
'users' => [
|
// 'users' => [
|
||||||
'provider' => 'users',
|
// 'provider' => 'users',
|
||||||
'table' => 'password_resets',
|
// 'table' => 'password_resets',
|
||||||
|
// 'expire' => 60,
|
||||||
|
// ],
|
||||||
|
'receivers' => [
|
||||||
|
'provider' => 'receivers',
|
||||||
|
'table' => 'password_resets_for_receiver',
|
||||||
'expire' => 60,
|
'expire' => 60,
|
||||||
],
|
],
|
||||||
|
'caseBuilders' => [
|
||||||
|
'provider' => 'caseBuilders',
|
||||||
|
'table' => 'password_resets_for_casebuilder',
|
||||||
|
'expire' => 60,
|
||||||
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class RenameResetPasswordTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('password_resets', function (Blueprint $table) {
|
||||||
|
$table->rename('password_resets_for_receiver');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('password_resets_for_receiver', function (Blueprint $table) {
|
||||||
|
$table->rename('password_resets');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreatePasswordResetsForCasebuilderTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('password_resets_for_casebuilder', function (Blueprint $table) {
|
||||||
|
$table->string('email')->index();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('password_resets_for_casebuilder');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreatePasswordResetsForAdminTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('password_resets_for_admin', function (Blueprint $table) {
|
||||||
|
$table->string('email')->index();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('password_resets_for_admin');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class ModifiyPasswordResetsForReceiverColumn extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('Receiver', function (Blueprint $table) {
|
||||||
|
$table->unique('email');
|
||||||
|
});
|
||||||
|
Schema::table('password_resets_for_receiver', function (Blueprint $table) {
|
||||||
|
$table->foreign('email', 'fk_password_resets_for_receiver_1')->references('email')->on('Receiver')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('password_resets_for_receiver', function (Blueprint $table) {
|
||||||
|
$table->dropForeign('fk_password_resets_for_receiver_1');
|
||||||
|
});
|
||||||
|
Schema::table('Receiver', function (Blueprint $table) {
|
||||||
|
$table->dropUnique('email');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class ModifiyPasswordResetsForCasebuilderColumn extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('CaseBuilder', function (Blueprint $table) {
|
||||||
|
$table->unique('contactEmail');
|
||||||
|
});
|
||||||
|
Schema::table('password_resets_for_casebuilder', function (Blueprint $table) {
|
||||||
|
$table->foreign('email', 'fk_password_resets_for_casebuilder_1')->references('contactEmail')->on('CaseBuilder')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('password_resets_for_casebuilder', function (Blueprint $table) {
|
||||||
|
$table->dropForeign('fk_password_resets_for_casebuilder_1');
|
||||||
|
});
|
||||||
|
Schema::table('CaseBuilder', function (Blueprint $table) {
|
||||||
|
$table->dropUnique('contactEmail');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class DropPasswordResetsForAdminTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('password_resets_for_admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::create('password_resets_for_admin', function (Blueprint $table) {
|
||||||
|
$table->string('email')->index();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -21,6 +21,10 @@ Route::get('/', 'Home\HomeController@index')->name('home');
|
|||||||
// 登入相關的
|
// 登入相關的
|
||||||
// Authentication Routes...
|
// Authentication Routes...
|
||||||
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
||||||
|
Route::get('/receiver/login', 'Auth\LoginController@showReceiverLoginForm')->name('receiver.login');
|
||||||
|
Route::get('/casebuilder/login', 'Auth\LoginController@showCaseBuilderLoginForm')->name('casebuilder.login');
|
||||||
|
Route::get('/admin/login', 'Auth\LoginController@showAdminLoginForm')->name('admin.login');
|
||||||
|
|
||||||
Route::post('login', 'Auth\LoginController@login');
|
Route::post('login', 'Auth\LoginController@login');
|
||||||
Route::post('logout', 'Auth\LoginController@logout')->name('logout');
|
Route::post('logout', 'Auth\LoginController@logout')->name('logout');
|
||||||
|
|
||||||
@ -54,8 +58,6 @@ Route::group(['prefix' => 'casebuilder'], function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 管理者相關url
|
// 管理者相關url
|
||||||
// Route::group(['prefix' => 'admin'], function () {
|
Route::group(['prefix' => 'admin'], function () {
|
||||||
// Route::get('/login', '');
|
// Route::get('/dashbord', '');
|
||||||
// Route::post('/login', '');
|
});
|
||||||
// Route::get('/dashbord', '');
|
|
||||||
// });
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user