Ejemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     GiftUser::truncate();
     $data = [['user_id' => 3, 'gift_id' => 1]];
     GiftUser::insert($data);
 }
Ejemplo n.º 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!');
 }