eloquent

php
<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\PostResource;

Cursor Pagination for Eloquent Queries Exposed as a JSON API in Laravel

laravel eloquent pagination
by codesnips 3 tabs
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\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Idempotent Stripe Webhook Processing With a Processed-Events Table in Laravel

laravel webhooks idempotency
by codesnips 3 tabs
php
<?php

namespace App\Observers;

use App\Models\Product;
use App\Jobs\WarmRelatedProductsCache;

Warm a Related-Products Cache with a Queued Laravel Job on Inventory Change

laravel php caching
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\Models;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

Queued Saved-Search Digest Emails for New Listings in Laravel

laravel queues eloquent
by codesnips 3 tabs
php
<?php

namespace App\Tenancy;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

Enforce Multi-Tenant Isolation in Laravel with a Global Scope Bound to the Current User

laravel multi-tenancy eloquent
by codesnips 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