public function input() { $app = app(); if (Request::has('token')) { $token = Request::input('token', ''); $compare = GlobalLibrary::tokenExtractor($token); $users_checker = GlobalLibrary::CheckUsersToken($compare); //echo '<pre>'.print_r($compare).'</pre>'; if ($users_checker[0]) { $uname = $users_checker[1]; $uid = $users_checker[2]; $email = $users_checker[3]; $field_user_detail = array('schedule_title' => Request::input('ttl'), 'schedule_type_id' => Request::input('typ'), 'schedule_users_creator' => $uid, 'schedule_users_source' => Request::input('usc'), 'schedule_date_start' => Request::input('dst'), 'schedule_date_end' => Request::input('dnd'), 'schedule_description' => Request::input('des'), 'schedule_headline' => Request::input('hed'), 'schedule_media_id' => Request::input('med'), 'schedule_publish' => Request::input('pub'), 'schedule_repeat' => Request::input('rpt')); $schedule = table_schedule::create($field_user_detail); return (new Response(array('status' => true, 'msg' => 'success'), 200))->header('content-Type', "json"); } else { return (new Response(array('status' => false, 'msg' => 'Authentication Failed2'), 200))->header('content-Type', "json"); } } else { return (new Response(array('status' => false, 'msg' => 'Authentication Failed1'), 200))->header('content-Type', "json"); } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { table_schedule::find($id)->delete(); return redirect('admin/schedule')->with('warning', 'Data have been removed!'); }