55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class TravelCategory
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property Collection|Booking[] $bookings
|
|
* @property Collection|Lead[] $leads
|
|
* @package App\Models
|
|
* @property-read int|null $bookings_count
|
|
* @property-read int|null $leads_count
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory whereName($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class TravelCategory extends Model
|
|
{
|
|
protected $connection = 'mysql';
|
|
|
|
protected $table = 'travel_category';
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'active'
|
|
];
|
|
|
|
public function bookings()
|
|
{
|
|
return $this->hasMany(Booking::class);
|
|
}
|
|
|
|
public function leads()
|
|
{
|
|
return $this->hasMany(Lead::class, 'travelcategory_id');
|
|
}
|
|
|
|
public function travel_programs()
|
|
{
|
|
return $this->hasMany(TravelProgram::class, 'travel_category');
|
|
}
|
|
}
|