Laravel DX Pain Points: Type Hints, Model Schemas, and Migration Automation
Hey Laravel community,
I’m loving Laravel but hitting some DX snags coming from TypeScript world. Here’s what’s bugging me:
No Type Autocompletion: Example User::find($id) returns User|null, but my IDE (VS Code) doesn’t warn about $user->name null errors or autocomplete properties. Socialite::driver() lacks driver suggestions too.
No Model Schema: Eloquent models don’t define properties, so I’m blind on $user->name vs $user->foo without checking migrations.
Manual Migrations: Writing every migration by hand is slow—Drizzle auto-generates them from a schema diff.
PHP Intelephense Is Not Accurate: Many times, Intelephense provides incorrect warnings.
Why isn’t the Laravel team tackling these? PHP’s typed now, and other frameworks offer this out of the box. I wish they’d add native type hints (e.g., User::find(): User|null), a $schema in models for autocompletion, and a migrate:from-model command. It’d make Laravel’s DX killer for typed-language devs like me.
Technically, you can uninstall Laravel Blade formatter and Laravel Extra Intellisence after that, or related extensions, but of course try to see what's best for you.
On a side note, even with this plugin, if you wish to have the best experience with PHP in general, and Laravel in this case, PhpStorm is the best option. It all depends on your needs.