File: /var/www/plan-b.bradford/app/Models/PaymentConceptLinks.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PaymentConceptLinks extends Model
{
protected $table = 'payment_concept_links';
protected $primaryKey = 'id';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'payment_concept_id',
'payment_method_id',
'user_created',
'created_at',
'user_updated',
'updated_at',
];
public function payment_concept()
{
return $this->belongsTo(PaymentConcepts::class, 'payment_concept_id');
}
public function payment_method()
{
return $this->belongsTo(PaymentMethods::class, 'payment_method_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');
}
public function deletedBy()
{
return $this->belongsTo('App\Models\Users', 'user_deleted');
}
}