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
Can't create a model with attributes #5
Comments
Hello @diegofer79, thanks for sharing this problem. I personally haven't experienced this issue, and so I'll like a little more information about your setup. What is the exact error thrown or returned when you try to use Model::create Also are you using leaf alone, or with a framework like leaf MVC or leaf API? |
Hi, I'm using leaf API, maybe I don't have the last version, idk
(vendor/leafs/leaf/changelog sais v2.1.0 - 19th June, 2020)
I have a model "Genre" which extends Model
So, when I seed the database I use:
Genre::create(['description' => 'Genre test 1']);
It doesn't save it on db if I use a not null field on mysql genres table,
if I put valid null on genres table, it is saved but with null value.
[image: image.png]
I tweak this file adding optional attributes and works fine.
[image: image.png]
Maybe isn't the right way to do it, (I'm new at leaf, eloquent, etc)
Thanks anyway
El dom., 12 jul. 2020 a las 16:11, Michael Darko (<notifications@github.com>)
escribió:
… Hello @diegofer79 <https://github.com/diegofer79>, thanks for sharing
this problem. I personally haven't experienced this issue, and so I'll like
a little more information about your setup.
What is the exact error thrown or returned when you try to use
Model::create
Also are you using leaf alone, or with a framework like leaf MVC or leaf
API?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/leafsphp/leaf/issues/34#issuecomment-657262840>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AICXCXO6RYCSTVYVHF6JZWLR3IDFHANCNFSM4OXNV57A>
.
--
Die.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm using leaf to an personal proyect, and I discover that if I have a $fillable attribute on a model I can't create one passing that parameter.
Genre::create(['description' => 'Genre test 1']);
//description isn't populate
thansk!
PS: Sorry if my english isn't good
The text was updated successfully, but these errors were encountered: