Hey filament developers, Is it possible to achieve this? If yes then i'll be happy to know how 🙌
github.com/filamentphp/filament/discussions/14206
How each work in this situation? Why there is no parenthesis?
public function handle(): void
{
User::where('email_verified_at', null)
->where('updated_at', '<', now()->subDay())
->whereDoesntHave('links', function (Builder $query): void {
$query->where('created_at', '<', now()->subDay());
})
->whereDoesntHave('questionsSent', function (Builder $query): void {
$query->where('created_at', '<', now()->subDay());
})
->whereDoesntHave('questionsReceived', function (Builder $query): void {
$query->where('created_at', '<', now()->subDay());
})
->get()
->each
->purge();
}
•
Tip of the day: The Null Coalescing Assignment Operator (??=)
mostafaamine.com/tips/the-null-coalescing-assignment-operator-a-concise-way-to-set-default-values-in-php