Skip to content

Commit

Permalink
Merge pull request #6 from gaffel/patch-1
Browse files Browse the repository at this point in the history
Use getMorphClass instead of get_class
  • Loading branch information
mpociot authored Feb 28, 2019
2 parents 995ccf2 + c0ab0d3 commit d2c4707
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Vouchers.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function create(Model $model, int $amount = 1, array $data = [], $expires
foreach ($this->generate($amount) as $voucherCode) {
$vouchers[] = Voucher::create([
'model_id' => $model->getKey(),
'model_type' => get_class($model),
'model_type' => $model->getMorphClass(),
'code' => $voucherCode,
'data' => $data,
'expires_at' => $expires_at,
Expand Down

0 comments on commit d2c4707

Please sign in to comment.