Skip to content
Snippets Groups Projects
Commit 38acc4e9 authored by Kenneth Halim's avatar Kenneth Halim
Browse files

add user role models

parent a6484f0e
No related merge requests found
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Dosen extends Model
{
const STATUS_PENGUJI_2 = 1;
const STATUS_PENGUJI_1 = 2;
const STATUS_PEMBIMBING = 3;
}
......@@ -6,5 +6,21 @@ use Illuminate\Database\Eloquent\Model;
class Mahasiswa extends Model
{
const STATUS_MENUNGGU_TOPIK = 0;
const STATUS_SIAP_SEMINAR_TOPIK = 1;
const STATUS_MENUNGGU_PROPOSAL = 2;
const STATUS_SIAP_SEMINAR_PROPOSAL = 3;
const STATUS_MASA_BIMBINGAN = 4;
const STATUS_SIAP_SEMINAR_TESIS = 5;
const STATUS_SIAP_SIDANG_TESIS = 6;
const STATUS_LULUS = 7;
const STATUS_STRINGS = [
"Menunggu Topik","Siap Seminar Topik", "Menunggu Proposal", "Siap Seminar Proposal", "Masa Bimbingan",
"Siap Seminar Tesis", "Siap Sidang Tesis", "Lulus"
];
public function getStatus($status) {
return Mahasiswa::STATUS_STRINGS[$status];
}
//
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Manajer extends Model
{
//
}
......@@ -14,7 +14,9 @@ class CreateMahasiswasTable extends Migration
public function up()
{
Schema::create('mahasiswas', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
// $table->integer('status');
$table->integer('tesis_id');
$table->timestamps();
});
}
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDosensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('dosens', function (Blueprint $table) {
$table->unsignedInteger('user_id');
$table->integer('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('dosens');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateManajersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('manajers', function (Blueprint $table) {
$table->increments('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('manajers');
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment