Replies: 3 comments 1 reply
-
Although nice to have in your use case, the problem with stubs is, they use simple string replacement and therefore, when a placeholder should have a default value, it cannot simply be omitted, which would all models to have redundant properties when one hasn't your use case. |
Beta Was this translation helpful? Give feedback.
-
You're right, the default model stub that ships with Laravel doesn't have a {{table}} placeholder. To add custom placeholders like that, you'll need to publish and modify the stub yourself. Here are the steps: Publish the model stub:
$factory->define(App\Models{{class}}, function () {
php artisan make:model MyModel -f The -f flag tells it to use the factory, which will populate the custom placeholders. |
Beta Was this translation helpful? Give feedback.
-
thank you, but what is Is there something to publish? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am porting to laravel a huge project where all models need to customize table and id
i would like to could make a stub like this
But
make:model
command is not populating thetable
placeholderAlso, I cannot find any doc about which placeholders are available in which stub
Beta Was this translation helpful? Give feedback.
All reactions