Skip to content

Implement event triggering on file generation #56728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: 12.x
Choose a base branch
from

Conversation

mohammadqasemi
Copy link

This PR adds an automatic event trigger in the GeneratorCommand class. Whenever a file is generated (e.g., a controller, model, or class), the event is fired. This allows other parts of the application to react to file creation, such as logging, additional processing, or notifications

u01jmg3 and others added 16 commits July 7, 2025 09:27
laravel#56216)

* Formatting

* Add breaking test to demo config array has been incorrectly keyed with numbers

* Correct how base options for missing config files are preloaded
The Symfony Command uses the AsCommand attribute to set properties on
the command class. However, the properties are only set if they are
identical to an empty string. The Laravel Command class overrides the
properties and removes the default value which causes the properties to
be null and therefore not set.
…ravel#56338) (laravel#56617)

* consistent use of mb_split to split strings into words with multi-byte support

* The $pattern argument doesn't use /pattern/ delimiters, unlike other regex functions such as preg_match

Co-authored-by: Sebastian Hädrich <11225821+shaedrich@users.noreply.github.com>
* Test Improvements

- Fix integration with PHPUnit 12.3.4
- Fix PHPStan

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* Apply fixes from StyleCI

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
fix laravel#56639

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
- Create FileGenerated event in Illuminate\Console\Events
- Stores path and type of generated file
- Modify handle() method to dispatch FileGenerated event
- Keep previous functionality intact
- Change @return to bool|null
- Add note about firing FileGenerated event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants