Esempio n. 1
0
 public function run()
 {
     DB::table('techs')->delete();
     $collection = [['disassemblers_id' => 1, 'team_id' => 2, 'firstname' => 'Peter', 'lastname' => 'Parker', 'phone' => '6159991000', 'email' => '*****@*****.**', 'title' => 'SpiderMan'], ['disassemblers_id' => 1, 'team_id' => 2, 'firstname' => 'Tony', 'lastname' => 'Stark', 'phone' => '7029991000', 'email' => '*****@*****.**', 'title' => 'IronMan'], ['disassemblers_id' => 1, 'team_id' => 2, 'firstname' => 'Clint', 'lastname' => 'Barton', 'phone' => '3109991000', 'email' => '*****@*****.**', 'title' => 'Hawkeye'], ['disassemblers_id' => 1, 'team_id' => 3, 'firstname' => 'Rachael', 'lastname' => 'Roth', 'phone' => '2109991000', 'email' => '*****@*****.**', 'title' => 'Raven'], ['disassemblers_id' => 1, 'team_id' => 3, 'firstname' => 'Diana', 'lastname' => 'Prince', 'phone' => '9019991000', 'email' => '*****@*****.**', 'title' => 'Wonder Woman'], ['disassemblers_id' => 1, 'team_id' => 3, 'firstname' => 'Barry', 'lastname' => 'Allen', 'phone' => '3029991000', 'email' => '*****@*****.**', 'title' => 'Flash'], ['disassemblers_id' => 1, 'team_id' => 3, 'firstname' => 'Donald', 'lastname' => 'Blake', 'phone' => '8889991000', 'email' => '*****@*****.**', 'title' => 'Thor'], ['disassemblers_id' => 1, 'team_id' => 3, 'firstname' => 'Bruce', 'lastname' => 'Banner', 'phone' => '1909991000', 'email' => '*****@*****.**', 'title' => 'Hulk'], ['disassemblers_id' => 1, 'team_id' => 4, 'firstname' => 'Steve', 'lastname' => 'Rogers', 'phone' => '7779991000', 'email' => '*****@*****.**', 'title' => 'Captain America'], ['disassemblers_id' => 1, 'team_id' => 4, 'firstname' => 'Kate', 'lastname' => 'Manzer', 'phone' => '5169991000', 'email' => '*****@*****.**', 'title' => 'Hawkgirl'], ['disassemblers_id' => 1, 'team_id' => 4, 'firstname' => 'Billy', 'lastname' => 'Batson', 'phone' => '1099991000', 'email' => '*****@*****.**', 'title' => 'Shazam'], ['disassemblers_id' => 1, 'team_id' => 4, 'firstname' => 'Sharon', 'lastname' => 'Carter', 'phone' => '7209991000', 'email' => '*****@*****.**', 'title' => 'Agent 13'], ['disassemblers_id' => 1, 'team_id' => 1, 'firstname' => 'Ray', 'lastname' => 'Palmer', 'phone' => '7209991050', 'email' => '*****@*****.**', 'title' => 'The Atom']];
     foreach ($collection as $record) {
         Tech::create($record);
     }
 }
Esempio n. 2
0
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Tech::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }