| 123456789101112131415161718192021 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\LogModelChanging;
- class Station extends Model
- {
- use LogModelChanging;
- protected $fillable=['name', 'code', 'station_type_id','sequence','parent_id'];
- public function type(){
- return $this->belongsTo(StationType::class,'station_type_id');
- }
- public function parent(){
- return $this->belongsTo(Station::class,'parent_id','id');
- }
- }
|