Skip to content

Instantly share code, notes, and snippets.

View crnkovic's full-sized avatar
🎯
Focusing

Josip Crnković crnkovic

🎯
Focusing
View GitHub Profile
@crnkovic
crnkovic / test.php
Created July 30, 2024 12:03
Scheduling in chunk
<?php
private function scheduleAppHomeUpdates(Schedule $schedule): void
{
$ttl = now()->addMinutes(30);
$users = (int) Cache::remember('total-users', $ttl, function () {
return User::whereHas(
'workspace', fn ($q) => $q->whereNull('locked_at')->whereNotNull('onboarded_at')
)->count();
@crnkovic
crnkovic / AppServiceProvider.php
Created August 19, 2018 11:20
Custom credentials feature for Nexmo in Laravel notifications
<?php
// app/Providers/AppServiceProvider.php
namespace App\Providers;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\ServiceProvider;
use App\Notifications\ChannelManager as MyChannelManager;