Skip to content
New issue

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

getOrCreate not working #55

Open
niraligajera opened this issue Feb 27, 2024 · 1 comment
Open

getOrCreate not working #55

niraligajera opened this issue Feb 27, 2024 · 1 comment

Comments

@niraligajera
Copy link

niraligajera commented Feb 27, 2024

$db->cron_time->getOrCreate(['name' => 'product']);

value not inserted in database

@oscarotero
Copy link
Owner

If the value is created, it's not inserted automatically. You have to call save().

Example:

$row = $db->cron_time->getOrCreate(['name' => 'product']);
$row->save();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants