Skip to content

Commit 3497096

Browse files
author
Andrey Helldar
committed
Added Model Helper primaryKeyType method
1 parent e460543 commit 3497096

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: src/Support/ModelHelper.php

+14
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ public function primaryKey($model): string
6868
->getKeyName();
6969
}
7070

71+
/**
72+
* @param \Illuminate\Database\Eloquent\Model|string $model
73+
*
74+
* @throws \Helldar\LaravelSupport\Exceptions\IncorrectModelException
75+
*
76+
* @return string
77+
*/
78+
public function primaryKeyType($model): string
79+
{
80+
return $this
81+
->model($model)
82+
->getKeyType();
83+
}
84+
7185
/**
7286
* @param \Illuminate\Database\Eloquent\Model|string $model
7387
*

0 commit comments

Comments
 (0)