php

php
<?php

namespace App\Http\Controllers\Auth;

use App\Events\UserRegistered;
use App\Http\Controllers\Controller;

Dispatch a Queued Welcome Email via Laravel Event Listeners on Registration

laravel events listeners
by codesnips 4 tabs
php
<?php

use Illuminate\Support\Facades\Http;

// Retry with exponential backoff
$response = Http::retry(3, 100, function ($exception, $request) {

Laravel HTTP client for API consumption

laravel http-client api
by Carlos Mendez 3 tabs
php
<?php

namespace App\Jobs;

use App\Models\Invoice;
use App\Services\StripeGateway;

Preventing Double-Charges in Laravel with WithoutOverlapping Job Middleware

laravel queues background-jobs
by codesnips 3 tabs
php
<?php

declare(strict_types=1);

namespace App\Security;

PHP Login Rate Limiting with a Sliding-Window Throttle Middleware

php rate-limiting middleware
by codesnips 3 tabs
php
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Syncing Article Tags Through a Many-to-Many Pivot in Laravel

laravel eloquent many-to-many
by codesnips 4 tabs
php
<?php

namespace App\Policies;

use App\Models\Post;
use App\Models\User;

Laravel policies for authorization

laravel authorization policies
by Carlos Mendez 3 tabs
php
<?php

namespace Tests\Feature;

use App\Models\Post;
use App\Models\User;

Laravel test writing with PHPUnit

laravel testing phpunit
by Carlos Mendez 2 tabs
php
<?php

namespace App\Events;

use App\Models\Order;
use Illuminate\Broadcasting\InteractsWithSockets;

Laravel event-driven architecture with listeners

laravel events listeners
by Carlos Mendez 4 tabs
php
<?php

namespace App\Http\Controllers;

use App\Models\Post;
use Illuminate\Http\Request;

Laravel pagination with custom views

laravel pagination eloquent
by Carlos Mendez 3 tabs