Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Regione extends Model
- {
- protected $table = 'regioni';
- public function province()
- {
- return $this->hasMany('App\Provincia');
- }
- }
- class Provincia extends Model
- {
- protected $table = 'province';
- public function regione()
- {
- return $this->belongsTo('App\Regione');
- }
- public function dipendenti()
- {
- return $this->hasMany('App\Dipendente');
- }
- }
- class Dipendente extends Model
- {
- protected $table = 'dipendenti';
- public function province()
- {
- return $this->belongsToMany('App\Provincia');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement