When creating a basic model in Laravel, I extend the Eloquent
class so that my model has all of the awesome Eloquent functionality. For example:
class Product extends \Eloquent {
//class definition here
}
I've been reading through the Laravel framework source code, and I don't understand where this Eloquent
class actually comes from. I can see there is a Illuminate\Database\Eloquent\Model
class, which seems to have all of the functionality I would expect from the Eloquent
class that I'm extending, but I'm confused how the inheritance is actually working since I'm extending Eloquent
, not Illuminate\Database\Eloquent\Model
.
How does this work?