Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone authored Oct 27, 2022
1 parent d67fe97 commit 40388ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/eloquent.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ function table_name($model): string
return $model->getTable();
}

/**
* Get the primary key value from Eloquent model.
*
* @param \Illuminate\Database\Eloquent\Model|null $model
* @return int|string|null
*/
function safe_key(?Model $model)
{
if (\is_null($model)) {
Expand Down

0 comments on commit 40388ff

Please sign in to comment.