Analyze Laravel Projects with Introspect
July 1, 2025Analyze Laravel Codebases with Laravel Introspect
If you’re doing a complex refactor or building dev tools, Laravel Introspect helps you query your app code—views, models, routes, classes—using a type-safe fluent API.
Main Features
- Fluent queries for views, routes, classes, and models.
- Wildcard support (e.g.
components.*.button). - Parse Eloquent model properties, relationships, casts.
- Serialize/deserialize queries as JSON (great for LLM tools).
Usage Examples
use Mateffy\Introspect\Facades\Introspect;
// Find views used by certain pages
$views = Introspect::views()
->whereNameEquals('components.*.button')
->whereUsedBy('pages.admin.*')
->get();
// Query routes using auth middleware and POST method
$routes = Introspect::routes()
->whereUsesMiddleware('auth')
->whereUsesMethod('POST')
->get();
// Extract model schema or JSON Schema
$detail = Introspect::model(User::class);
$schema = $detail->schema();
Check it out on GitHub: capevace/laravel-introspect.
Blog
Jul 20, 2025
A detailed, example-rich guide to avoid slowdowns in Laravel apps by optimizing data retrieval and employing indexing smartly. 1. 🧠Fetch Only...
Aug 09, 2025
Object-Oriented Programming (OOP) is a modern software development approach that divides an application into units called Objects that interact with...
Jul 30, 2025
Why Performance Is Non-Negotiable In today’s fast-paced world, no one has time to wait for a slow-loading website. On mobile, users abandon...
Jul 27, 2025
Here’s a complete breakdown of essential tools to level up your Laravel development: Inertia.js v2, View Creators, and the Laravel HLS package...
Sep 13, 2025
If you want to send Push Notifications from your Laravel app to mobile or web clients, the fastest and simplest way is to use Notifire. It integrate...
Jun 26, 2025
Color Everything in CSS – Simple Guide Today we’re diving into CSS colors: how to define them, especially with modern methods like lab(...