/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     GiftUser::truncate();
     $data = [['user_id' => 3, 'gift_id' => 1]];
     GiftUser::insert($data);
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $gift_user = GiftUser::findOrFail($id);
     $gift_user->delete();
     return redirect()->route('admin.giftUser.index')->with('message', 'Xóa thành công!');
 }