59 lines
1.6 KiB
PHP
59 lines
1.6 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)
|
|
* @property int|null $active
|
|
* @property-read Collection<int, \App\Models\TravelProgram> $travel_programs
|
|
* @property-read int|null $travel_programs_count
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TravelCategory whereActive($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');
|
|
}
|
|
}
|