function addeduc($_post) { $user->id = $this->getuser(); $profile = new Education($user->id); $result = $profile->create($_post); return $result; }
/** * Store a newly created education in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), Education::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } Education::create($data); return Redirect::route('educations.index'); }
/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); // $this->call(UserTableSeeder::class); DB::table('education')->delete(); Education::create(['edu_id' => '0', 'edu_level' => 'None'], ['edu_id' => '1', 'edu_level' => 'Preschool'], ['edu_id' => '2', 'edu_level' => 'Elementary'], ['edu_id' => '3', 'edu_level' => 'High school'], ['edu_id' => '4', 'edu_level' => 'College']); DB::table('completed')->delete(); Completed::create(['id_completed' => '0', 'author' => 'Patient'], ['id_completed' => '1', 'author' => 'Caregiver'], ['id_completed' => '2', 'author' => 'Caregiver-assisted']); DB::table('admin')->delete(); Admin::create(['id_admin' => '0', 'email' => '*****@*****.**', 'password' => 'pass']); Model::reguard(); }
<?php include_once "../../../../../../libraries/aces/models/education.php"; // echo json_encode($filter); $_POST['userid'] = $_POST['userid']; $_POST['school'] = $_POST['school']; $_POST['fieldofstudy'] = $_POST['fieldofstudy']; $_POST['dateattendfrom'] = $_POST['dateattendfrom']; $_POST['dateattendto'] = $_POST['dateattendto']; $_POST['degree'] = $_POST['degree']; $_POST['grade'] = $_POST['grade']; $_POST['description'] = $_POST['description']; $edu = new Education(); $data = $edu->create($_POST); echo json_encode($data); // echo json_encode($_POST); // foreach($data as $edudata){ // echo json_encode($edudata); // }