单击
导航栏时如何自动重新加载页面?我有这行代码。 此代码会在血液活动已超过活动结束日期时删除通知。
我有一张这样的桌子。
Latest Blood Campaign
---------------------------------------------------
id CampaignTitle CampaignAddress CampaignStartDate CampaignEndDate
1 Blood Letting New York 2016-02-24 2016-02-26
Admin Send Notifications
------------------------------------------------------------
id receiver messageBody
1 jk Please come to our blood campaign
My code to delete notification.
<?php
$dateToday2 = '2016-02-29';
$latest2 = LatestBloodCampaign::all();
foreach ( $latest2 as $data2 )
if($dateToday2 <= $data2->campaignEndDate)
{ }else{
DB::table('admin_send_notifications')
->where('receiver', 'jk')
->where('messageBody', $notification->messageBody)
->delete();
} ?>
我将这行代码放入通知页面,因此当它加载时它会自动删除,但当它只单击导航栏时,它不会删除。
您需要
创建一个专用于删除Campaigns
的路由。指向路由的链接将触发路由,响应应重定向回提供初始页面的路由。