public function update($id) { // save updated $record = $this->records->find($id); if (!$record) { Corporation::create(Input::all()); return $this->respond($record); } $record->fill(Input::all())->save(); return $this->respond($record); }
public function create(User $profile, Skill $skill) { $user = Auth::user(); $sender_id = $user->id; $receiver_id = $profile->id; $skill_id = $skill->id; $found = Corporation::where('sender_id', $user->id)->where('receiver_id', $receiver_id)->where('skill_id', $skill_id)->exists(); if ($found) { //corporation already exists Flash::error(trans('messages.corporationExists')); } else { $corporation = Corporation::create(['sender_id' => $sender_id, 'receiver_id' => $receiver_id, 'skill_id' => $skill_id]); $this->stream($corporation, $receiver_id); Flash::success(trans('messages.corporationCreated')); } return redirect()->back(); }
public function run() { DB::table('corporations')->delete(); Corporation::create(['applicant_id' => 4, 'corporation' => 'SHIELD', 'ssn' => '929293393', 'address' => 'Communications Department', 'city' => 'Sky Carrier', 'state_id' => 4, 'zip' => '77631', 'email' => '*****@*****.**', 'phone' => '5125555050', 'description' => 'S.H.I.E.L.D. is an espionage and law-enforcement agency in the Marvel Comics Universe. Created by Stan Lee and Jack Kirby in Strange Tales #135 (Aug. 1965), it often deals with paranormal and superhuman threats. The acronym originally stood for Supreme Headquarters, International Espionage, Law-Enforcement Division. It was changed in 1991 to Strategic Hazard Intervention Espionage Logistics Directorate.', 'president' => 'Fury, Nick S.', 'vicepresident' => 'Coulson, Phil', 'secretary' => 'Hill, Maria', 'treasurer' => 'Sitwell, Jasper']); }