update
This commit is contained in:
@@ -15,7 +15,7 @@ class UserFactory extends Factory
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'nama' => $this->faker->name(),
|
||||
'name' => $this->faker->name(),
|
||||
'email' => $this->faker->unique()->safeEmail(),
|
||||
't_daftar' => now(),
|
||||
'status' => 'active',
|
||||
|
||||
@@ -15,7 +15,7 @@ class CreateUsersTable extends Migration
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nama');
|
||||
$table->string('name');
|
||||
$table->string('kodcaw')->nullable();
|
||||
$table->string('nokp')->nullable();
|
||||
$table->string('bank_acc_pembeli')->nullable();
|
||||
|
||||
@@ -27,11 +27,12 @@ class CreatePermissionTables extends Migration
|
||||
|
||||
Schema::create($tableNames['permissions'], function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name'); // For MySQL 8.0 use string('name', 125);
|
||||
$table->string('name');
|
||||
$table->string('description'); // For MySQL 8.0 use string('name', 125);
|
||||
$table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['name', 'guard_name']);
|
||||
$table->unique(['name','description','guard_name']);
|
||||
});
|
||||
|
||||
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
|
||||
|
||||
@@ -21,33 +21,92 @@ class RolesSeeder extends Seeder
|
||||
|
||||
// create permissions
|
||||
//admin
|
||||
Permission::create(['name' => 'pengguna']);
|
||||
Permission::create(['name' => 'pengurusanlelongan']);
|
||||
Permission::create(['name' => 'analisa']);
|
||||
Permission::create([
|
||||
'name' => 'pengguna',
|
||||
'description' => 'Pengurusan Pengguna'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'pengurusanlelongan',
|
||||
'description' => 'Pengurusan Lelong'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'analisa',
|
||||
'description' => 'Analisa lelong'
|
||||
]);
|
||||
|
||||
//khazanah
|
||||
Permission::create(['name' => 'semakanmarhun']);
|
||||
Permission::create(['name' => 'kemaskinimarhun']);
|
||||
Permission::create([
|
||||
'name' => 'semakanmarhun',
|
||||
'description' => 'Semakan marhun'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'kemaskinimarhun',
|
||||
'description' => 'Kemaskini marhun'
|
||||
]);
|
||||
|
||||
//teller
|
||||
Permission::create(['name' => 'pengesahanbayarancash']);
|
||||
Permission::create([
|
||||
'name' => 'pengesahanbayarancash',
|
||||
'description' => 'Pengesahan bayaran pembida di cawangan (cash)'
|
||||
]);
|
||||
|
||||
//pengurus cawangan
|
||||
Permission::create(['name' => 'pendaftaranpembida']);
|
||||
Permission::create(['name' => 'jananotis']);
|
||||
Permission::create([
|
||||
'name' => 'pendaftaranpembida',
|
||||
'description' => 'Pemdaftaran pembida di cawangan'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'jananotis',
|
||||
'description' => 'Jana Notis Lelong'
|
||||
]);
|
||||
|
||||
//jurulelong
|
||||
Permission::create(['name' => 'pendaftaranbatch']);
|
||||
Permission::create(['name' => 'kemaskinihargaasas']);
|
||||
Permission::create(['name' => 'import']);
|
||||
Permission::create(['name' => 'lelongan']);
|
||||
Permission::create(['name' => 'janapemenang']);
|
||||
Permission::create([
|
||||
'name' => 'pendaftaranbatch',
|
||||
'description' => 'Daftar batch lelong'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'kemaskinihargaasas',
|
||||
'description' => 'Kemaskini harga asas mengikut harga emas semasa'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'import',
|
||||
'description' => 'Import senarai marhun cawangan to LIVE'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'lelongan',
|
||||
'description' => '(online/offline) lelong mengikut cawangan'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'janapemenang',
|
||||
'description' => 'Pemilihan pemenang bagi bidaan paling tinggi'
|
||||
]);
|
||||
|
||||
//operasi
|
||||
//Permission::create(['name' => 'pendaftaranbatch']); di jurulelong dah ada
|
||||
Permission::create(['name' => 'report']);
|
||||
Permission::create(['name' => 'tangguhan']);
|
||||
Permission::create([
|
||||
'name' => 'report',
|
||||
'description' => 'Full report lelongan'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'tangguhan',
|
||||
'description' => 'Tangguh lelong'
|
||||
]);
|
||||
|
||||
//account
|
||||
Permission::create(['name' => 'pengesahanbayaran']);
|
||||
Permission::create([
|
||||
'name' => 'pengesahanbayaran',
|
||||
'description' => 'Pengesahan pembayaran pembida dalam akaun yang dibuat melalui (cdm,fpx)'
|
||||
]);
|
||||
|
||||
//pembida
|
||||
// Permission::create(['name' => 'pendaftaranpembida']); di pc dah ada
|
||||
Permission::create(['name' => 'bidaan']);
|
||||
Permission::create(['name' => 'pembayaran']);
|
||||
Permission::create([
|
||||
'name' => 'bidaan',
|
||||
'description' => 'Pendaftaran bagi yang belum mempunyai akaun di cawangan ataupun kata laluan atas talian'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'pembayaran',
|
||||
'description' => 'Pembayaran pemenang'
|
||||
]);
|
||||
|
||||
// create roles and assign existing permissions
|
||||
$role1 = Role::create(['name' => 'admin']);
|
||||
@@ -92,56 +151,56 @@ class RolesSeeder extends Seeder
|
||||
|
||||
// create demo users
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Admin',
|
||||
'name' => 'Admin',
|
||||
'username' => 'Admin',
|
||||
'email' => 'admin@example.com',
|
||||
]);
|
||||
$user->assignRole($role1);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Khazanah',
|
||||
'name' => 'Khazanah',
|
||||
'username' => 'Khazanah',
|
||||
'email' => 'khazanah@example.com',
|
||||
]);
|
||||
$user->assignRole($role2);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Teller',
|
||||
'name' => 'Teller',
|
||||
'username' => 'Teller',
|
||||
'email' => 'teller@example.com',
|
||||
]);
|
||||
$user->assignRole($role3);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Pengurus Cawangan',
|
||||
'name' => 'Pengurus Cawangan',
|
||||
'username' => 'PC',
|
||||
'email' => 'penguruscawangan@example.com',
|
||||
]);
|
||||
$user->assignRole($role4);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Juru Lelong',
|
||||
'name' => 'Juru Lelong',
|
||||
'username' => 'Juru Lelong',
|
||||
'email' => 'jurulelong@example.com',
|
||||
]);
|
||||
$user->assignRole($role5);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Operasi',
|
||||
'name' => 'Operasi',
|
||||
'username' => 'Operasi',
|
||||
'email' => 'operasi@example.com',
|
||||
]);
|
||||
$user->assignRole($role6);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Account',
|
||||
'name' => 'Account',
|
||||
'username' => 'Account',
|
||||
'email' => 'account@example.com',
|
||||
]);
|
||||
$user->assignRole($role7);
|
||||
|
||||
$user = \App\Models\User::factory()->create([
|
||||
'nama' => 'Pembida',
|
||||
'name' => 'Pembida',
|
||||
'username' => 'Pembida',
|
||||
'email' => 'pembida@example.com',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user