30 lines
830 B
PHP
30 lines
830 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\LogActivity;
|
|
|
|
class FileDirectory extends Model
|
|
{
|
|
protected $connection = 'dbDirectory';
|
|
protected $table = 'public.file_directory';
|
|
public $timestamps = false;
|
|
protected $primaryKey = 'file_directory_id';
|
|
protected $guarded = ['file_directory_id'];
|
|
|
|
public function viewLogs()
|
|
{
|
|
return $this->hasMany(LogActivity::class, 'file_directory_id', 'file_directory_id')
|
|
->where('statusenabled', true)
|
|
->where('action_type', 'Membuka Dokumen');
|
|
}
|
|
public function downloadLogs()
|
|
{
|
|
return $this->hasMany(LogActivity::class, 'file_directory_id', 'file_directory_id')
|
|
->where('statusenabled', true)
|
|
->where('action_type', 'Download Dokumen');
|
|
}
|
|
|
|
}
|