سؤال

Save to the database with the following code. Event refers to a custom model.

$currentEvent = new Event;

$currentEvent->end = $event['end_time'];

$currentEvent->save();

What's going on here - is the save method conflicting with something?

هل كانت مفيدة؟

المحلول

Event is a kind of a reserved name in Laravel. You have two options:

1) Use a different one for your model.

2) Use namespaces.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top