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...

php
<?php

namespace App\Events;

use App\Models\Message;
use App\Models\User;

Laravel broadcasting with Pusher for real-time events

laravel broadcasting websockets
by Carlos Mendez 3 tabs
php
<?php

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

Laravel database migrations for schema management

laravel migrations database
by Carlos Mendez 3 tabs
json
{
  "private": true,
  "scripts": {
    "dev": "vite",
    "build": "vite build"
  },

Laravel mix/Vite for asset compilation

laravel vite assets
by Carlos Mendez 4 tabs
php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

Laravel file storage with disk abstraction

laravel storage filesystem
by Carlos Mendez 3 tabs
blade
@props(['type' => 'info', 'dismissible' => false])

@php
$classes = [
    'info' => 'bg-blue-100 border-blue-500 text-blue-700',
    'success' => 'bg-green-100 border-green-500 text-green-700',

Laravel Blade components for reusable UI

laravel blade components
by Carlos Mendez 4 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\Models;

use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;

Laravel accessors and mutators for attribute handling

laravel eloquent accessors
by Carlos Mendez 3 tabs
php
<?php

use Illuminate\Support\Facades\Cache;

// Remember pattern - fetch from cache or execute closure
$posts = Cache::remember('posts.all', 3600, function () {

Laravel cache strategies for performance

laravel cache performance
by Carlos Mendez 4 tabs
php
<?php

namespace App\Models;

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

Laravel scopes for reusable query logic

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

namespace App\Notifications;

use App\Models\Post;
use Illuminate\Bus\Queueable;

Laravel notifications for multi-channel messaging

laravel notifications email
by Carlos Mendez 2 tabs
php
<?php

namespace App\Providers;

use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

Laravel rate limiting for API protection

laravel rate-limiting api
by Carlos Mendez 2 tabs
vue
<template>
  <form @submit.prevent="form.post(route('posts.store'))">
    <div>
      <label>Title</label>
      <input v-model="form.title" type="text" />
      <div v-if="form.errors.title">{{ form.errors.title }}</div>

Laravel Inertia.js for modern SPAs

laravel inertia spa
by Carlos Mendez 3 tabs