Carlos Mendez

37 code snips · on codesnips 5 months

Laravel expert specializing in scalable web applications, RESTful APIs, and modern PHP development. Proficient in Eloquent ORM, queues, events, testing, and frontend integration...

blade
{{-- resources/views/errors/503.blade.php --}}
<!DOCTYPE html>
<html>
<head>
    <title>Maintenance Mode</title>
    <style>

Laravel maintenance mode and health checks

laravel maintenance health-checks
by Carlos Mendez 3 tabs
php
<?php

namespace App\Providers;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;

Laravel macro methods for extending framework

laravel macros extensibility
by Carlos Mendez 3 tabs
php
<?php

namespace VendorName\PackageName;

use Illuminate\Support\ServiceProvider;

Laravel package development

laravel packages composer
by Carlos Mendez 3 tabs
php
<?php

namespace App\Scopes;

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

Laravel global query scopes with database views

laravel scopes database-views
by Carlos Mendez 4 tabs
php
<?php

use App\Models\Post;
use App\Models\Comment;
use Illuminate\Support\Facades\Route;

Laravel route model binding

laravel routing model-binding
by Carlos Mendez 3 tabs
php
<?php

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

Laravel soft deletes for data retention

laravel soft-deletes eloquent
by Carlos Mendez 3 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

return [
    'welcome' => 'Welcome to our application!',
    'greeting' => 'Hello, :name',
    'posts' => [

Laravel localization for multi-language apps

laravel localization i18n
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
php
<?php

namespace App\Observers;

use App\Events\PostPublished;
use App\Models\Post;

Laravel model observers for lifecycle hooks

laravel observers eloquent
by Carlos Mendez 2 tabs
php
<?php

namespace App\Rules;

use Closure;
use Illuminate\Contracts\Validation\ValidationRule;

Laravel custom validation rules

laravel validation custom-rules
by Carlos Mendez 3 tabs
php
<?php

namespace App\Console\Commands;

use App\Models\User;
use App\Notifications\NewsletterEmail;

Laravel custom Artisan commands

laravel artisan commands
by Carlos Mendez 2 tabs