2016-04-29 105 views
1

我有一個問題,使用LARAVEL VALIDATIONlaravel validation with delete_at

我希望deleted_at爲空,但我得到deleted_at = NULL

'level_name' => 'unique:company_levels,level_name,' . $id . ',id,company_id,' . $company_id.',deleted_at,null', 

它生成一個查詢像下面

select count(*) as aggregate from `company_level` where `level_name` = 'Chennai' and `id` <> 1 and `company_id` = 3 and `deleted_at` = null 
這是不符合我的需要

我需要生成類似下面

select count(*) as aggregate from `company_level` where `level_name` = 'Chennai' and `id` <> 1 and `company_id` = 3 and `deleted_at` is null 

由於查詢提前

回答

0

問題通過更換空爲NULL解決。空

退出查詢

使用資本NULL替換

',deleted_at,null', 

我通過

',deleted_at,NULL', 
取代了它