Station.php 449 B

123456789101112131415161718192021
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\LogModelChanging;
  5. class Station extends Model
  6. {
  7. use LogModelChanging;
  8. protected $fillable=['name', 'code', 'station_type_id','sequence','parent_id'];
  9. public function type(){
  10. return $this->belongsTo(StationType::class,'station_type_id');
  11. }
  12. public function parent(){
  13. return $this->belongsTo(Station::class,'parent_id','id');
  14. }
  15. }