Skip to content

Code generation

Overview

Laravel Idea contains a lot of convenient code generations. They are accessible from the Laravel main menu item > Code generation:

Or just by key combination (Ctrl-Shift-Comma by default). Generations list with effective search:

Code generations

  • Custom code generations
  • Eloquent Helper Code Generation - details in the Eloquent section
  • Create Broadcasting Channel
  • Create Console Command
  • Create Controller
  • Create Database Factory - details in the Eloquent section
  • Create Database Migration
  • Create Database Seeder
  • Create Event
  • Create Event Listener
  • Create Exception
  • Create Feature Test
  • Create Form Request
  • Create HTTP Exception
  • Create Job
  • Create Json Resource - details in the Eloquent section
  • Create Json Resource Collection
  • Create Mailable
  • Create Middleware
  • Create Model
  • Create Notification
  • Create Observer
  • Create Policy
  • Create Resource Controller
  • Create Service Provider
  • Create Unit Test
  • Create Validation Rule
  • Create View
  • Create View Composer
  • Create Module - code generation for module applications
  • Create Blade Component - for Laravel >= 7
  • Create Livewire Component - if Livewire is detected
  • Create Dusk Test - if Dusk package is detected
  • Create Dusk Page - if Dusk package is detected
  • Create Dusk Component - if Dusk package is detected
  • Create Nova Resource - - if Nova package is detected. Details in the Nova page.

Configuration

Code generations are highly customizable:

Base namespaces or directories, base classes and templates. Templates can be changed in File | Settings | Editor | File and Code Templates:

Modules

Laravel Idea supports modules. It can be useful for projects built using file structure described here - https://stitcher.io/blog/laravel-beyond-crud-01-domain-oriented-laravel or with nWidart/laravel-modules package. They can be configured here - File | Settings | Languages & Frameworks | Laravel Idea | Module System. Read more about modules in the special Modules page.