소스 검색

add function create new credential

master
Siti Hajar Ibrahim 5 년 전
부모
커밋
b68d04a5b4
2개의 변경된 파일25개의 추가작업 그리고 5개의 파일을 삭제
  1. 24
    5
      app/Http/Controllers/Controller.php
  2. 1
    0
      routes/web.php

+ 24
- 5
app/Http/Controllers/Controller.php 파일 보기

@@ -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 파일 보기

@@ -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']);

Loading…
취소
저장