context:delete Command¶
Last updated: 2025-10-09 (Europe/Paris)
Removes the files generated for a context resource—models, controllers, policies, Filament resources, etc.—after an interactive prompt. This is the counterpart to context:make.
Usage¶
php artisan context:delete {name} --context={ContextName?}
name(required) — Resource to clean up (StudlyCase).--context(optional) — Target context (defaults toCore).
You’ll be prompted to select which artifacts to delete (Model, Migration, Controller, API Controller, Requests, Factory, Policy, Resource, Filament Resource, Repository, Action, DTO, Contract, Provider, Event, Middleware, Observer, Job, Notification, Listener, Mail, Rule, Cast, Scope, Trait, Enum, Seeder, Command, Config, Interface). Each option maps to the files created by context:make; repository cleanup also removes bindings via make:repository:delete, and global assets (seeders, commands, configs, interfaces) are removed from their framework directories.
Prefer
delete:rawdigs-domain; the legacydelete:deepdigs-domainalias remains available for old scripts.
Composer & Sail Shortcut¶
composer run context:delete -- Artist --context=Creators
The composer script auto-detects Sail. To run it manually:
./vendor/bin/sail artisan context:delete Artist --context=Creators
Related Docs¶
docs/commands/context-make.md— How resources are scaffolded.docs/contexts/accounts/entity-diagram.md— Relationship between Accounts and creator artifacts.