File: /var/www/plan-b.bradford/app/Models/ContractComments.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ContractComments extends Model
{
protected $table = 'contract_comments';
protected $primaryKey = 'id';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'contract_id',
'comment',
'files_comment',
'created_at',
'user_created',
'updated_at',
'user_updated',
'deleted',
'user_deleted',
'deleted_at'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
public function contract_data()
{
return $this->belongsTo('App\Models\Contracts', 'contract_id');
}
// Relaciones con el modelo Users
public function createdBy()
{
return $this->belongsTo('App\Models\Users', 'user_created');
}
public function updatedBy()
{
return $this->belongsTo('App\Models\Users', 'user_updated');
}
}