A standalone Laravel playground that demonstrates PHPantom's Laravel-specific features against a real Laravel installation.
- Collection property types. Literal property paths determine collection keys and plucked values, including grouped collections and higher-order proxies. See
Demo::collectionPropertyTypes(). - Eloquent models. Virtual properties from model column attributes,
$fillable,$casts,$attributes, relationships, scopes, accessors, custom collections, and query builder forwarding. A method a model or its builder does not answer is reported, since Eloquent throws for it (see the "Try:" inDemo::eloquentQuery()). - Mass assignment. See how the warning changes when the same attribute array is passed to a totally guarded model in
Demo::fillPost(). - Computed attributes. Column suggestions distinguish stored values from accessors, while assignment suggestions include attributes with setters. See
Demo::computedAttributes(). - Model factories. Convention-based factories (no
@extends Factory<Model>needed) getcreate()/make()returning the model, plus the dynamichas{Relationship}()/for{Relationship}()methods synthesized from the model's relationships, andtrashed()when the model usesSoftDeletes— all chaining fluently (e.g.BlogAuthor::factory()->hasPosts(3)->create()). SeeDemo::factories(). - Config and env navigation. Go-to-definition and find-references for
config('app.name')keys (resolves toconfig/app.php) andenv('APP_KEY')vars (resolves to.env). - Authorization abilities. Complete a policy ability or jump to its declaration inside a typed customer's
can()call. SeeDemo::authorizationAbilities(). - Typed connection names. Completion, hover, navigation, references, and diagnostics follow the database, queue, or broadcasting receiver and model or job properties. See
Demo::typedConnections(). - View navigation. Go-to-definition for
view('welcome')andView::make('admin.users.index')(resolves to Blade templates inresources/views/). - Asset paths.
asset('css/app.css')andVite::asset()/@vitepaths complete from the files on disk, jump to the file, and are reported when nothing is there. Inertia page names (Inertia::render('Users/Index')) work the same way in a project that installs Inertia. - Route navigation. Go-to-definition for
route('home')(resolves to->name('home')in route files). - Controller action navigation. Go-to-definition, hover, rename, references, and completion for route action strings in
[Controller::class, 'method']callables andRoute::controller(...)->group(...)routes. - Related classes. Code lenses link a model to its factory, policy, observers, migrations, API resources, and custom collection, link a factory, policy, or observer back to its model, and link an event to its listeners and back. See
app/Models/BlogPost.phpandapp/Events/BlogPostPublished.php. - Routes on controller methods. A code lens above each controller action lists the routes that reach it (verb, URI, and name) and jumps to where each is registered.
- Rate limiter names. Complete, hover, navigate, and check the names registered by service providers in
throttle:nameand queue middleware. TryDemo::rateLimiterNames(). - Middleware names. Completion, hover, go-to-definition, find-references, and unknown-name diagnostics for the aliases and groups
->middleware(...),->withoutMiddleware(...), and the#[Middleware]controller attribute name, from the framework's defaults and the onesbootstrap/app.phpregisters. SeeDemo::middlewareNames(). InBakeryController::__construct(), complete the guard insideauth:adminor jump to its configuration. - Translation navigation. Go-to-definition for
__('messages.welcome'),trans('auth.failed'), andtrans_choice(...)(resolves tolang/PHP files). - Artisan command names & signatures. Completion, go-to-definition, hover, and unknown-name diagnostics for command names in
Artisan::call(...),Artisan::queue(...),Schedule::command(...), and$this->call(...)(resolves to the command class declared by$signature/$name/#[Signature]/#[AsCommand]). Inside a command,$this->argument(...)/$this->option(...)complete, hover, and validate against that command's own signature, and the parameter array ofArtisan::call('cmd', [...])completes its argument and--optionkeys. SeeDemo::artisanCommands()andapp/Console/Commands/. - Validation rules. Completion, hover, navigation, and diagnostics for validation strings and their references. See
Demo::validationRuleStrings()andapp/Http/Requests/ValidationDemoRequest.php. - Blade component libraries. Flux's
<flux:button>and Filament's<x-filament::button>complete, offer their attributes, jump to the package's template, and are reported when misspelt. Seeresources/views/ui-libraries.blade.php. - Blade template intelligence. Variable completion and hover in
{{ }}expressions (shown ase()calls), go-to-definition on@include/@extendsview references,@forelse/@emptydirectives, implicit$loopvariable in@foreach/@forelse, implicit$messagein@error, implicit$valuein@session,@verbatimblock handling, and standalone@vardocblocks for type narrowing. Code actions work in templates too: importing a class adds a@usedirective.
- Run
composer installin this directory to install Laravel. - Open this directory as a project (or workspace folder) in your editor.
- Open
app/Demo.phpand navigate to anydemo()method. - Trigger completion, hover, or go-to-definition inside the method body.