Answers for "laravel unique except, some operation on query"

0

laravel unique except, some operation on query

public function rules()
    {
        return [
            'name' => [
                'required',
                'email',
                Rule::unique('users', 'email')
                    ->where(static function ($query) {
                        return $query->whereNull('deleted_at');
                    })
                    ->ignore($this->user),
            ]
        ];
    }
Posted by: Guest on May-10-2021

Code answers related to "laravel unique except, some operation on query"

Browse Popular Code Answers by Language