We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
if you customize users foreign key in the config, create method throws an exception user_id column can not be found.
something like this do the trick:
return $this->generate()->map(fn(string $code) => app(PromocodeContract::class)->create([ config('promocodes.models.users.foreign_id') => optional($this->user)->id, 'code' => $code, 'usages_left' => $this->unlimited ? -1 : $this->usagesLeft, 'bound_to_user' => $this->user || $this->boundToUser, 'multi_use' => $this->multiUse, 'details' => $this->details, 'expired_at' => $this->expiredAt, ]));
The text was updated successfully, but these errors were encountered:
Have same problem
Sorry, something went wrong.
No branches or pull requests
Hi,
if you customize users foreign key in the config, create method throws an exception user_id column can not be found.
something like this do the trick:
The text was updated successfully, but these errors were encountered: