edms2023/app/RemoteContact.php

31 lines
704 B
PHP
Raw Permalink Normal View History

2023-09-14 20:59:46 +00:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class RemoteContact extends Model
{
protected $fillable = ['contact_id', 'direction', 'login', 'password', 'public_key', 'description'];
public function contact()
{
return $this->belongsTo(Contact::class, 'contact_id');
}
public function remotecontactapis()
{
return $this->hasMany(RemoteContactApi::class);
}
public function getDirection()
{
return ($this->direction) ? "Out" : "In";
}
public function getDirectionWithArrow()
{
return ($this->direction) ? "Out <i class='fa fa-long-arrow-right'></i>" : "In <i class='fa fa-long-arrow-left'></i>";
}
}