Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request alsofronie#42 from wvdongen/master
Browse files Browse the repository at this point in the history
Set primary key type to string.
  • Loading branch information
alsofronie authored Jan 3, 2020
2 parents 19302d1 + 3fa3d6f commit 13b0a43
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Uuid32ModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ public function getIncrementing()
return false;
}

/**
* This function is used internally by Eloquent models to set the data type for the primary key.
*
* @return string Always string
*/
public function getkeyType()
{
return 'string';
}

/**
* This function overwrites the default boot static method of Eloquent models. It will hook
* the creation event with a simple closure to insert the UUID
Expand Down
10 changes: 10 additions & 0 deletions src/UuidModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ public function getIncrementing()
return false;
}

/**
* This function is used internally by Eloquent models to set the data type for the primary key.
*
* @return string Always string
*/
public function getkeyType()
{
return 'string';
}

/**
* This function overwrites the default boot static method of Eloquent models. It will hook
* the creation event with a simple closure to insert the UUID
Expand Down

0 comments on commit 13b0a43

Please sign in to comment.