GiacomoM's avatar

Laravel 5: Difference between Model and Eloquent

Hi everybody, as subject I don't know which are the differences between Model and Eloquent in Laravel 5.

I am trying to use this code:

$data = Input::all();
$newEvent = Event::create($data);   

But I get an error cause "create" is not defined.

Thanks in advence

0 likes
2 replies
joedawson's avatar

I think this may be because the Event facade by be conflicting with your model.

Try using the full namespace to your model.

$data = Input::all();
$newEvent = \App\Event::create($data);   
GiacomoM's avatar

It worked, thanks.

What about the difference between Model and Eloquent?

On the web I found both the classes used.

Please or to participate in this conversation.