I am after some laravel advice on this. I have this situation (pseudo-code):
class Base extends Eloquent {}
class Child1 extends Base {}
class Child2 extends Base {}
They are models and all 3 have their own database tables. Essentially idea is that base model has attributes that are applicable to both children and each child has their own.
What I wanted to know is how can I access attributes from Base model from the child? For instance if the base model has attribute "title" I want to be able to do something like this:
In controller for example Child1::find(1)->title it would print out the title which is an attribute of Base. Currently it seems that if I do just the above, I cannot access attributes from Base without say declaring them first. Is there a laravel 4 specific way of achieving this? Or do I need to go though Base and specifically say: public $title = ''; public $some_other_attribute = '';
So that Child can access them directly? I have a FK from Child to base.
Thanks for the advice!