Closed Javier-Rotelli closed 6 years ago
i can't install success.
`
in VoyagerUser.php (line 53)
`
@ngoclanbaby86, your error is unrelated. Please open your own issue (or better yet, search through recent issues/PRs as that one was just recently fixed)
@Javier-Rotelli,
A migration can't easily use the model from the config because it uses the table directly. We're working on splitting the install process so new apps can use voyager:install
and existing apps (like yours) can follow the steps manually, with the docs indicating likely failure points and what to do about them.
@fletch3555 my intention was to use getTable
to get the model's table name.
but yeah, this approach may be too naive to work reliably. nonetheless i have a couple of free hours, so i may try it just to see how it breaks :P
OTOH, is there a way to help with splitting the install process?
Thanks!
You're more than welcome to try it. I'd be interested to see just how it breaks as well.
As for helping, I think the biggest changes are going to be a confirmation when running voyager:install
on whether you have an existing app (which will cancel out of the script telling you to follow the "alternate install" steps. Then we add those steps to the docs, with notes between each identifying ways the step will fail (like if the next step is to run migrations, "you should edit the migrations first if you already have any of the following tables: a, b, c". Stuff like that. The docs let anyone suggest changes, so if you'd like to work on that, I can go create a page for you to work against
so, I got some progress on the change migrations front. it now knows the correct table, but for some reason the previous migration did not add the correct fields to the table...
(voyager-test) ✗ php artisan voyager:install
Setting up the hooks
Hooks are now ready to use! Go ahead and try to "php artisan hook:install test-hook"
Publishing the Voyager assets, database, language, and config files
Copied Directory [/vendor/tcg/voyager/publishable/assets] To [/public/vendor/tcg/voyager/assets]
Publishing complete.
Copied Directory [/vendor/tcg/voyager/publishable/database/seeds] To [/database/seeds]
Publishing complete.
Copied Directory [/vendor/tcg/voyager/publishable/demo_content] To [/storage/app/public]
Publishing complete.
Publishing complete.
Copied Directory [/vendor/tcg/voyager/publishable/lang] To [/resources/lang]
Publishing complete.
Copied File [/vendor/intervention/image/src/config/config.php] To [/config/image.php]
Publishing complete.
Migrating the database tables into your application
In SchemaException.php line 86:
There is no column with name 'role_id' on table 'usuarios'.
here's what i've been doing: https://github.com/Javier-Rotelli/voyager/tree/custom-user-table-name
Regarding the docs, if you want do it, but i'd want to really understand the install process before starting to write about it :D maybe i can start drafting it here, or in another issue until we have a "working" version
well, we figured that it would be way easier to start from scratch to migrate to 5.5. so i don't have a testbed anymore. so i'm going to close this. for future reference. here's the repo with the work i did to try to make this work https://github.com/Javier-Rotelli/voyager/tree/custom-user-table-name
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Description:
so, i'm trying to add voyager to a project i already have, however we do not use a table called
users
to store our users. and this causes the initial migrations to fail.Steps To Reproduce:
Create a new laravel project. Change the default User model to use another table name( for example,
usuarios
) Add voyager, try to run the install script:I've created a
config/voyager.php
with the following content:this time it went on, but it failed because the data migrations try to use the
users
table:I'm going to see if i can get a simple PR to check if it can be fixed by updating the migrations to take into account the model defined in the config.