'int', 'booking_id' => 'int', 'status' => 'int' ]; protected $fillable = [ 'travel_country_service_id', 'booking_id', 'status' ]; protected $status_type = [ 0 => 'offen', 1 => 'erledigt', ]; public function booking() { return $this->belongsTo(Booking::class); } public function travel_country_service() { return $this->belongsTo(TravelCountryService::class); } public static function getStatus($travel_country_service_id, $booking_id){ $booking_country_service = BookingCountryService::where('travel_country_service_id', '=', $travel_country_service_id) ->where('booking_id', '=', $booking_id)->first(); if($booking_country_service){ return $booking_country_service->status; } return 0; } }