2

In Laravel 8, I'm making a webapp, I enabled the default user registration with jetstream + livewire. Also, I added Voyager as an admin panel. I have a small issue in my users table I have both 'profile_photo_path' (From Laravel's default migration) and I also have 'avatar' (From Voyager).

Is there a way to unify that? I'm thinking maybe I can remove the profile_photo_path from the migration (As that's part of the project's files) and just use avatar.

Maybe that's configurable and I don't know that.

Jorge Anzola
  • 1,165
  • 3
  • 13
  • 33
  • can't you reset the migration again though it will result in a loss of data – bhucho Nov 05 '20 at 18:14
  • I can, the data doesn't matter at this point cause it's only in my local env so far. My doubt was more about if it will screw something up by changing the property. Maybe I can just overwrite `profile_photo_path` in this class [vendor/laravel/jetstream/src/HasProfilePhoto.php](https://github.com/laravel/jetstream/blob/1.x/src/HasProfilePhoto.php), IDK what it will break. Maybe I'll just give it a shot and test the whole thing. – Jorge Anzola Nov 05 '20 at 19:20
  • its a trait, you can try for it, to change the name to avatar key, but you will have to check for wherever this trait is used in the package, maybe a global search of the whole project will help. – bhucho Nov 05 '20 at 19:23

1 Answers1

1

Well, by changing the HasProfilePhoto trait and removing profile_photo_path from database/migrations/2014_10_12_000000_create_users_table.php I managed to use only one column (avatar) for both the Jetstream users and the Voyager users.

I simply replaced profile_photo_path ---> avatar in the trait, it all seems to be working so I don't think it broke something.

Jorge Anzola
  • 1,165
  • 3
  • 13
  • 33