-
Notifications
You must be signed in to change notification settings - Fork 65
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
[BUG] backpack:build copy found models in other directories (e.g. app/packages) into app/Models
.
#105
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication mediums:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Generator will search everything inside This is the problem, it's finding a @pxpm you may thought it "copied" the file, but it actually crated a new Model. I don't think Backpack should be worrying with models inside other folders other than Because if we were going to worry about models in Let me know what you think. |
Here's what I think we should do, from your conversation:
Additionally, to cover a very common use case where you have a BUNCH of models, don't need CRUDs for all of them, but don't want to run a command for each model either, we should let the user choose models to exclude. We should keep in mind that we'll want to use this same command inside DevTools, where we'll have a better interface for this:
To account for that future feature, but also provide a similar feature in the command line, what I propose we do is that we:
What do you guys think? (notice I've moved this to 4.2 - let's finish the bugs first, and afterwards Generators will be our first focus for improvements) |
I think it's the best approach 👍 Maybe we can use Artisan Console |
Or maybe something like the package https://github.com/eddiriarte/console-select |
Console-select looks good indeed, but I see its last update was in 2018... I'm a bit wary about adding a dependency like this... How does |
@tabacitu, [1] App\Models\Article
[2] App\Models\Category
[3] App\Models\Tag
[4] App\Packages\Something\Models\Test
[5] App\Packages\Something\Models\AnotherTest > 1, 2, 3 For me it's enough, I totally agree in avoiding dependencies 😅 but we may need to add a note to instruct devs on how to use |
Bug report
What I did:
I have some local packages (Models, Controllers etc) inside
app/packages
folder.When running
php artisan backpack:build
it find those models too. Problem is not finding them, is the fact the backpack copy them intoapp/Models
folder.This makes me also think we should have some
key
in config where we could add an array of locations to ignore searching for models.What I expected to happen:
Atmost, find the models and add the CrudTrait. Never copy them!
What happened:
My models were copied into
app/Models
What I've already tried to fix it:
Backpack, Laravel, PHP, DB version:
The text was updated successfully, but these errors were encountered: