如何使用多个值验证一个输入?我正在使用引导标签输入插件。它返回一个字段中的所有标签。我需要验证这个标签 - 独一无二。首先,我试图将此标签放入数组中,然后在请求中对其进行验证,但仍然没有运气。这是我的请求代码:
public function all()
{
$postData = parent::all();
// checkbox status
if(array_key_exists('keywords', $postData)) {
// put keywords into array
$keywords = explode(',', $postData['keywords']);
$test = [];
$i = 0;
foreach($keywords as $keyword)
{
$test[$i] = $keyword;
$i++;
}
$postData['keywords'] = $test;
}
return $postData;
}
public function rules()
{
$rules = [
'title' => 'required|min:3|unique:subdomain_categories,title|unique:subdomain_keywords,keyword',
'description' => '',
'image' => 'required|image',
'keywords.*' => 'min:3'
];
return $rules;
}
Run Code Online (Sandbox Code Playgroud)
但是一旦关键字无效,我就会收到此错误:
helpers.php 第 531 行中的 ErrorException: htmlentities() 期望参数 1 为字符串,给定数组。 …
我使用Laravel 5.4,我想向用户发送通知上thursdays的8pm
假设我有
我应该如何设置 CRON JOB 以便他们都8pm在本地时间收到通知?。
我的服务器在纽约市
$schedule->command('sendNotifications')->dailyAt('20:00')->thursdays()