Initial commit

This commit is contained in:
Zakwan Hamdan
2020-10-19 10:12:55 +08:00
commit 60afe5d1ba
300 changed files with 144332 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
*.sqlite
*.sqlite-journal
+28
View File
@@ -0,0 +1,28 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', 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');
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}
@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('noic')->unique();
$table->string('alamat');
$table->string('main_phone');
$table->string('alternate_phone')->nullable();
$table->string('alamat_menyurat');
$table->integer('poskod');
$table->string('daerah');
$table->string('negeri');
$table->integer('umur');
$table->string('warganegara');
$table->string('bangsa');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers');
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateGadaianTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('gadaian', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('gadaian');
}
}
@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMarhunTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('marhun', function (Blueprint $table) {
$table->id();
$table->String('no_rujukan');
$table->String('marhun');
$table->String('note');
$table->boolean('rosak');
$table->boolean('putus');
$table->boolean('patah');
$table->boolean('permata');
$table->boolean('sebelah');
$table->String('karat');
$table->String('berat');
$table->float('harga');
$table->float('nilai_marhun');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('marhun');
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePenebusanTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('penebusan', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('penebusan');
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddRolesToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->String('roles');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('roles');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->String('role_name');
$table->String('role_code');
$table->String('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateHargaEmasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('harga_emas', function (Blueprint $table) {
$table->id();
$table->String('mutu_emas');
$table->String('karat');
$table->float('kaunter');
$table->float('harga_gram');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('harga_emas');
}
}
@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCawanganTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cawangan', function (Blueprint $table) {
$table->id();
$table->String('nama');
$table->String('code');
$table->String('alamat');
$table->String('poskod');
$table->String('daerah');
$table->String('negeri');
$table->String('no_telefon');
$table->String('no_fax');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cawangan');
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCawanganToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->String('cawangan');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('cawangan');
});
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddInfoUserToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->String('no_kp');
$table->String('no_telefon');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('no_kp');
$table->dropColumn('no_telefon');
});
}
}
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBangsaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bangsa', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bangsa');
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBankTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bank', function (Blueprint $table) {
$table->id();
$table->String('bank_name');
$table->String('bank_code');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bank');
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMediaTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('media', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('model');
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable();
$table->nullableTimestamps();
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::dropIfExists('media');
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
use Illuminate\Database\Seeder;
class BangsaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
use Illuminate\Database\Seeder;
class BankSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
use Illuminate\Database\Seeder;
class CawanganSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}
+17
View File
@@ -0,0 +1,17 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(HargaEmasSeeder::class);
$this->call(RolesSeeder::class);
}
}
+59
View File
@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Seeder;
class HargaEmasSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('harga_emas')->insert([
[
'mutu_emas' => '999',
'karat' => '24K',
'kaunter' => 183.68,
'harga_gram' => 262.40
],
[
'mutu_emas' => '950',
'karat' => '23K',
'kaunter' => 174.50,
'harga_gram' => 249.28
],
[
'mutu_emas' => '916',
'karat' => '22K',
'kaunter' => 168.25,
'harga_gram' => 240.36
],
[
'mutu_emas' => '900',
'karat' => '21K',
'kaunter' => 165.31,
'harga_gram' => 236.16
],
[
'mutu_emas' => '835',
'karat' => '20K',
'kaunter' => 153.57,
'harga_gram' => 219.10
],
[
'mutu_emas' => '750',
'karat' => '18K',
'kaunter' => 137.76,
'harga_gram' => 196.80
],
[
'mutu_emas' => '585',
'karat' => '14K',
'kaunter' => 137.76,
'harga_gram' => 153.50
]
]);
}
}
+98
View File
@@ -0,0 +1,98 @@
<?php
use Illuminate\Database\Seeder;
class PoskodSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('poskod')->insert([
[
'poskod'=>'01000',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01007',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01009',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01500',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01502',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01503',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01504',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01505',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01506',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01508',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01512',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01514',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01516',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01517',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01518',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01524',
'bandar'=>'Kangar',
'negeri'=>'PLS'
]
]);
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Seeder;
class RolesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB:table('roles')->insert([
[
'role_name' => 'Penolong Pengurus Cawangan',
'role_code' => 'PPC',
'description' => 'Penolong Pengurus Cawangan',
],
[
'role_name' => 'Khazanah',
'role_code' => 'Khazanah',
'description' => 'Khazanah',
],
[
'role_name' => 'Juruwang',
'role_code' => 'TT',
'description' => 'Juruwang',
],
[
'role_name' => 'Penilai',
'role_code' => 'PP',
'description' => 'Penilai',
]
]);
}
}
+81
View File
@@ -0,0 +1,81 @@
<?php
use Illuminate\Database\Seeder;
class StateSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('state')->insert([
[
'nama_negeri' => 'Kelantan',
'code_negeri' => 'KEL'
],
[
'nama_negeri' => 'Johor',
'code_negeri' => 'JHR'
],
[
'nama_negeri' => 'Kedah',
'code_negeri' => 'KDH'
],
[
'nama_negeri' => 'Kuala Lumpur',
'code_negeri' => 'KUL'
],
[
'nama_negeri' => 'Labuan',
'code_negeri' => 'LBN'
],
[
'nama_negeri' => 'Melaka',
'code_negeri' => 'MLK'
],
[
'nama_negeri' => 'Negeri Sembilan',
'code_negeri' => 'NSN'
],
[
'nama_negeri' => 'Pahang',
'code_negeri' => 'PHG'
],
[
'nama_negeri' => 'Penang',
'code_negeri' => 'PNG'
],
[
'nama_negeri' => 'Perak',
'code_negeri' => 'PRK'
],
[
'nama_negeri' => 'Perlis',
'code_negeri' => 'PLS'
],
[
'nama_negeri' => 'Putrajaya',
'code_negeri' => 'PJY'
],
[
'nama_negeri' => 'Sabah',
'code_negeri' => 'SBH'
],
[
'nama_negeri' => 'Sarawak',
'code_negeri' => 'SRW'
],
[
'nama_negeri' => 'Selangor',
'code_negeri' => 'SGR'
],
[
'nama_negeri' => 'Terengganu',
'code_negeri' => 'TRG'
]
]);
}
}