ldc-startcoq/app/Models/Survey.php

71 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2023-02-22 11:51:36 +01:00
<?php
namespace App\Models;
2023-06-21 10:24:56 +00:00
use App\Enums\Surveys\CustomerEnum;
2023-02-23 16:23:00 +01:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2023-02-22 11:51:36 +01:00
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
{
2023-02-23 16:23:00 +01:00
use HasFactory;
2023-02-22 11:51:36 +01:00
/**
* @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',
2023-02-23 16:23:00 +01:00
'documents' => 'json',
2023-02-22 11:51:36 +01:00
'is_distributor' => 'boolean',
'is_customer' => 'boolean',
2023-06-21 10:24:56 +00:00
'type' => CustomerEnum::class,
2023-02-22 11:51:36 +01:00
'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');
}
}