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