Replies: 2 comments
-
Just following up on my own discussion..
Hopefully this solves all issues I was having. Feedback welcome. :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('role_users', function (Blueprint $table) {
$table->char('user_id')->change();
});
}
/**
* Get the value indicating whether the IDs are incrementing.
*
* @return bool
*/
public function getIncrementing()
{
return false;
}
/**
* Get the auto-incrementing key type.
*
* @return string
*/
public function getKeyType()
{
return 'string';
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to make my Dashboard play along with Orchid's current implementation, but having my
User
model use uuid instead of integer as primary key. I managed to do it using Laravel 9'sHasUuids
trait and replacing the model class as specified here. This part seems to be fine.Unfortunately, it seems like this change does not play well with what's already there, as I'm stumbling with error after error, namely:
Role
model seems to break - probably becauserole_users
table has a composite key (['user_id', 'role_id']
). I tried castinguser_id
only to string, making an intermediate (extendingPivot
) table to cast the same field and several other methods... Can't get it working. Decided to leave Roles alone (will need them in the future but not strictly necessary right now) and move on, but...$user->id
(type uuid) property is being casted to an integer and trimmed at the first non-numeric character. Also, if I manually replace the ID on the URL and get to theUserEditScreen
I go back to problem number 1 because I can't load Roles.Just these 2 things make it practically impossible to use the existing User/Role CRUD boilerplate after that small change. Are there any suggestions in these regard? Am I missing something obvious here?
Beta Was this translation helpful? Give feedback.
All reactions