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 InquiryType
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property int $arrangement_type_id
|
|
* @property ArrangementType $arrangement_type
|
|
* @property Collection|Inquiry[] $inquiries
|
|
* @package App\Models
|
|
* @property-read int|null $inquiries_count
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType whereArrangementTypeId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType whereName($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class InquiryType extends Model
|
|
{
|
|
protected $connection = 'mysql';
|
|
|
|
protected $table = 'inquiry_type';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'arrangement_type_id' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'arrangement_type_id'
|
|
];
|
|
|
|
public function arrangement_type()
|
|
{
|
|
return $this->belongsTo(ArrangementType::class);
|
|
}
|
|
|
|
public function inquiries()
|
|
{
|
|
return $this->hasMany(Inquiry::class, 'type_id');
|
|
}
|
|
}
|