Master branch of laravel/framework
is 5.3. Master branch of laravel/laravel
is 5.2.
If you already have an instance of a model that you are filling, you would call save
.
Create
is creating a new model based on attributes passed in and returning a new model.
Since you never saved the model you have assigned to $platform
it has no id
attribute.
you are correct on the 5.2. Thanks.
The instance method create takes the values as well. That's the way I originally had this code; as that's what the docs said to do. That also does not return an id. That should probably be removed and just leave the static method, or fix it to return the id.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community