registerPolicies(); VerifyEmail::toMailUsing(function ($notifiable, $url) { return new UserEmailVerify($notifiable, $url); }); ResetPassword::toMailUsing(function ($notifiable, $url) { return new UserEmailReset($notifiable, $url); }); Gate::define('participate', function (User $user) { return !is_null(app('clientIp')) and !$user->participations() ->whereDate('updated_at', Carbon::now()->toDateString()) ->count() and Participation::where('ip', app('clientIp')) ->whereDate('updated_at', '=', Carbon::now()->toDateString()) ->count() <= 3; }); } }