Skip to content

Commit

Permalink
Added the beneficiaries migration, modified the LoginController- rese…
Browse files Browse the repository at this point in the history
…t to default
  • Loading branch information
bytenaija committed Sep 23, 2016
1 parent 0278ffe commit ba478ba
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 36 deletions.
72 changes: 36 additions & 36 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,41 @@ public function __construct() {
$this->middleware('guest', ['except' => 'logout']);
}

public function getLogin() {
return view('login.login');
}

public function postLogin(LoginRequest $request) {
$type = Request::get('type');
$user = '';
// $use = '';
if ($type == 'admin') {
$user = new AdminUser;

} else if ($type == 'client') {

} else {

}
$login = $user::where('email', Request::get('email'));

if($login->first() != null){


if ($login->first()->password == Request::get('password')){

return redirect(Request::get('type')."/");
}else{

return "Not logged in";
}
} else{

return "Error, user name";
}


// return Request::get('type') . $use ;
}
// public function getLogin() {
// return view('login.login');
// }
//
// public function postLogin(LoginRequest $request) {
// $type = Request::get('type');
// $user = '';
// // $use = '';
// if ($type == 'admin') {
// $user = new AdminUser;
//
// } else if ($type == 'client') {
//
// } else {
//
// }
// $login = $user::where('email', Request::get('email'));
//
// if($login->first() != null){
//
//
// if ($login->first()->password == Request::get('password')){
//
// return redirect(Request::get('type')."/");
// }else{
//
// return "Not logged in";
// }
// } else{
//
// return "Error, user name";
// }
//
//
//// return Request::get('type') . $use ;
// }

}
39 changes: 39 additions & 0 deletions database/migrations/2016_09_23_133413_beneficiaries.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Beneficiaries extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('Beneficiaries', function (Blueprint $table) {
$table->increments('id');
$table->string('beneficiary_id');
$table->string('firstname');
$table->string('lastname');
$table->string('sex');
$table->string('phone_number');
$table->string('lga');
$table->string('state');
$table->string('country');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('Beneficiaries');
}
}

0 comments on commit ba478ba

Please sign in to comment.