예제 #1
0
 public function run()
 {
     DB::table('rebators')->delete();
     $collection = [['loan_id' => 1, 'rebator' => 'Millers Gin', 'contact' => 'Eli Whitney', 'location' => 'Baton Rouge, LA', 'phone' => '2253189263', 'email' => '*****@*****.**'], ['loan_id' => 2, 'rebator' => 'Millers Gin', 'contact' => 'Eli Whitney', 'location' => 'Baton Rouge, LA', 'phone' => '2253189263', 'email' => '*****@*****.**']];
     foreach ($collection as $record) {
         Rebator::create($record);
     }
 }
예제 #2
0
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Rebator::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }