php - laravel 稍后插入数据
问题描述
public function index()
{
$value="";
$now = time();
if ($now == '1568739550'){
$dummy = new Dummy();
$dummy->name = "khan";
$dummy->save();
}else{
$value = "not okay";
}
return view('home', compact('now', 'value'));
}
当我包含刷新浏览器时它正在工作。否则它不工作
解决方案
用于此目的的碳如下..
// get the current time
$current = Carbon::now();
// add 30 days to the current time
$trialExpires = $current->addDay
然后简单地调用 if 函数
if(your condition)
{
//Login goes here
}
推荐阅读
- android - 将库添加到项目,Android
- php - 我如何将此代码用于任何数字而不仅仅是数字 1
- cygwin - Cygwin 中的 Gnuplot 不会显示终端输出(未能获取当前屏幕资源 qt.qpa.xcb.xcberror: QXcbConnection: XCB error...)
- python - 已解决:Selenium 未正确填写表格
- python - 无法阻止程序打印错误
- python - Python:复制 Matlab 的 generateMesh 函数
- c# - 如何在子查询中将字符串变量设置为属性
- python - Django - 使用多种选择进行建模的 ForeignKey
- sql - 更新集的列取决于另一个
- php - 无法通过 GoDaddy 共享 Windows 主机连接到外部 MS SQL Server 数据库(IP 白名单不起作用)