31 lines
704 B
PHP
31 lines
704 B
PHP
|
|
<?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>";
|
||
|
|
}
|
||
|
|
}
|