70 lines
1.5 KiB
PHP
70 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\Surveys\SurveyCustomerEnum;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @property integer $id
|
|
* @property integer $user_id
|
|
* @property string $name
|
|
* @property string $author
|
|
* @property string $comment
|
|
* @property string $date
|
|
* @property string $documents
|
|
* @property boolean $is_distributor
|
|
* @property boolean $is_customer
|
|
* @property boolean $type
|
|
* @property string $created_at
|
|
* @property string $updated_at
|
|
* @property string $deleted_at
|
|
* @property User $user
|
|
*/
|
|
class Survey extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'name',
|
|
'author',
|
|
'comment',
|
|
'date',
|
|
'documents',
|
|
'is_distributor',
|
|
'is_customer',
|
|
'type',
|
|
'created_at',
|
|
'updated_at',
|
|
'deleted_at'
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'date' => 'datetime:Y-m-d',
|
|
'documents' => 'json',
|
|
'is_distributor' => 'boolean',
|
|
'is_customer' => 'boolean',
|
|
'type' => SurveyCustomerEnum::class,
|
|
'created_at' => 'datetime:Y-m-d',
|
|
'updated_at' => 'datetime:Y-m-d',
|
|
'deleted_at' => 'datetime:Y-m-d',
|
|
];
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo('App\Models\User');
|
|
}
|
|
}
|