Skip to content

Instantly share code, notes, and snippets.

@vicgonvt
Last active September 4, 2019 00:00
Show Gist options
  • Select an option

  • Save vicgonvt/dc1d424e34c866c2544e1296206eb594 to your computer and use it in GitHub Desktop.

Select an option

Save vicgonvt/dc1d424e34c866c2544e1296206eb594 to your computer and use it in GitHub Desktop.
title Macroable Laravel Classes (Full List)
keywords laravel, coderstape, coder's tape, macros
description The macro trait allows you to add functionality to many Laravel classes. Here's a list of all of them.
date AUg 30, 2019
tags laravel, php
permalink macroable-laravel-classes-full-list
img https://coderstape.com/images/laravel-macros.jpg
author Victor Gonzalez
authorlink https://github.com/vicgonvt

Video

For the full explanation on how to use macros in Laravel, check out this full lesson on our YouTube channel.

Image of the lessons video for Laravel macros

Full List

The following list are all of the Laravel classes that currently use the Macroable trait and accept macro calls.

  • Illuminate\Auth\RequestGuard
  • Illuminate\Auth\SessionGuard
  • Illuminate\Cache\Repository
  • Illuminate\Console\Command
  • Illuminate\Console\Scheduling\Event
  • Illuminate\Cookie\CookieJar
  • Illuminate\Database\Eloquent\FactoryBuilder
  • Illuminate\Database\Eloquent\Relations\Relation
  • Illuminate\Database\Grammar
  • Illuminate\Database\Query\Builder
  • Illuminate\Database\Schema\Blueprint
  • Illuminate\Filesystem\Filesystem
  • Illuminate\Foundation\Testing\TestResponse
  • Illuminate\Http\JsonResponse
  • Illuminate\Http\RedirectResponse
  • Illuminate\Http\Request
  • Illuminate\Http\Response
  • Illuminate\Http\UploadedFile
  • Illuminate\Mail\Mailer
  • Illuminate\Routing\PendingResourceRegistration
  • Illuminate\Routing\Redirector
  • Illuminate\Routing\ResponseFactory
  • Illuminate\Routing\Route
  • Illuminate\Routing\Router
  • Illuminate\Routing\UrlGenerator
  • Illuminate\Support\Arr
  • Illuminate\Support\Collection
  • Illuminate\Support\LazyCollection
  • Illuminate\Support\Str
  • Illuminate\Support\Testing\Fakes\NotificationFake
  • Illuminate\Translation\Translator
  • Illuminate\Validation\Rule
  • Illuminate\View\Factory
  • Illuminate\View\View
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment