64 lines
1.9 KiB
PHP
64 lines
1.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class TravelCompany
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property float $percentage
|
|
* @property bool $is_allowed_edit_commission
|
|
* @property bool $is_inhouse
|
|
* @property Collection|Booking[] $bookings
|
|
* @property Collection|BookingServiceItem[] $booking_service_items
|
|
* @package App\Models
|
|
* @property-read int|null $booking_service_items_count
|
|
* @property-read int|null $bookings_count
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereIsAllowedEditCommission($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereIsInhouse($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereName($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany wherePercentage($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class TravelCompany extends Model
|
|
{
|
|
protected $connection = 'mysql';
|
|
|
|
protected $table = 'travel_company';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'percentage' => 'float',
|
|
'is_allowed_edit_commission' => 'bool',
|
|
'is_inhouse' => 'bool'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'percentage',
|
|
'is_allowed_edit_commission',
|
|
'is_inhouse'
|
|
];
|
|
|
|
public function bookings()
|
|
{
|
|
return $this->hasMany(Booking::class);
|
|
}
|
|
|
|
public function booking_service_items()
|
|
{
|
|
return $this->hasMany(BookingServiceItem::class);
|
|
}
|
|
}
|