diff --git a/app/Http/Controllers/DemoController.php b/app/Http/Controllers/DemoController.php index a0bda60..3e44c29 100644 --- a/app/Http/Controllers/DemoController.php +++ b/app/Http/Controllers/DemoController.php @@ -12,8 +12,10 @@ class DemoController extends Controller $this->validate($request, [ 'name' => 'required', 'role' => 'required', + 'email' => 'required', 'number_phone' => 'required', - 'message' => 'required', + 'status' => 'required', + 'message' => 'required' ]); $data = $request->all(); diff --git a/app/Http/Controllers/ScheduleDemoController.php b/app/Http/Controllers/ScheduleDemoController.php deleted file mode 100644 index f3a5130..0000000 --- a/app/Http/Controllers/ScheduleDemoController.php +++ /dev/null @@ -1,32 +0,0 @@ -validate($request, [ - 'name' => 'required', - 'role' => 'required', - 'email' => 'required', - 'number_phone' => 'required', - 'status' => 'required', - 'message' => 'required' - ]); - - $data = $request->all(); - - $data['created_by'] = $this->currentName; - $result = Demo::create($data); - - if ($result) { - return response()->json(['status' => 'success','data' => $result, 'message' => 'add schedule successfully!', 'code' => 200], 200); - } else { - return response()->json(['status' => 'failed', 'message' => 'add data schedule failed!', 'code' => 400], 400); - } - } -} diff --git a/routes/web.php b/routes/web.php index 31882d2..c40d8e9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -12,7 +12,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro $router->post('/company-management-user/search', 'CompanyController@search'); $router->post('/human-resource-user/add', 'HumanResourceController@add_user'); $router->get('/company-management-user/edit/{id}', 'CompanyController@edit'); - $router->post('/schedule-demo/add','ScheduleDemoController@add'); + $router->post('/demo-management-user/add', 'DemoController@add'); $router->post('/menu/add', 'MenuController@add'); $router->get('/menu/edit/{id}', 'MenuController@edit');