コード例 #1
0
 public function run()
 {
     DB::table('reportoptions')->delete();
     $users = User::all();
     foreach ($users as $user) {
         Reportoption::create(['user_id' => $user->id]);
     }
 }
コード例 #2
0
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Reportoption::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }