Procházet zdrojové kódy

add function create new credential

master
Siti Hajar Ibrahim před 5 roky
rodič
revize
b68d04a5b4
2 změnil soubory, kde provedl 25 přidání a 5 odebrání
  1. 24
    5
      app/Http/Controllers/Controller.php
  2. 1
    0
      routes/web.php

+ 24
- 5
app/Http/Controllers/Controller.php Zobrazit soubor

@@ -119,11 +119,30 @@ class Controller extends BaseController
$docket->forceDelete();
}

public function getDatabase(Request $request)
public function createNewCredential(Request $request)
{
$staff = Staff::all();
$staff_detail = StaffDetail::all();

return $staff . $staff_detail;
$staffD = new StaffDetail;
$staffD->name = 'Uhanis';
$staffD->ic = '-';
$staffD->email = 'uhanis@allo.my';
$staffD->phone = '-';
$staffD->company_id = '5b0e0375ee0dc2b6a20694b9';
$staffD->color = '';
$staffD->position = 'Customer Service';
$staffD->password = 'b3NsNHdxTndsUFBzNlhsMi9xVWxMUT09';
$staffD->user_pic = 'assets/avatar/user.png';

// Save Login Staff
$loginD = new Staff;
$loginD->email = 'uhanis@allo.my';
$loginD->password = 'b3NsNHdxTndsUFBzNlhsMi9xVWxMUT09';
$loginD->roles_access = 'Customer Service';
$loginD->company_id = '5b0e0375ee0dc2b6a20694b9';
$loginD->last_login_at = '';
$loginD->last_login_ip = '';

$company = Company::where('_id','5b0e0375ee0dc2b6a20694b9')->first();
$company->staff()->save($loginD);
$loginD->staffdetail()->save($staffD);
}
}

+ 1
- 0
routes/web.php Zobrazit soubor

@@ -16,6 +16,7 @@ Route::get('/', function () {

Route::get('/request-reset-docket', 'Controller@resetDocket');
Route::get('/get-database', 'Controller@getDatabase');
Route::get('/create-new-credential', 'Controller@createNewCredential');
// Route::get('/delete-dealer-claim', 'Controller@deleteTodayClaim');

Route::get('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']);

Načítá se…
Zrušit
Uložit