66 lines
1.4 KiB
PHP
66 lines
1.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
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
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @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' => JsonCast::class,
|
||
|
|
'is_distributor' => 'boolean',
|
||
|
|
'is_customer' => 'boolean',
|
||
|
|
'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');
|
||
|
|
}
|
||
|
|
}
|