|
|
<?php
namespace App\Documents;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Jenssegers\Mongodb\Eloquent\Model;
class ModelDocument extends Model { use HasFactory, BaseDocument;
protected $connection = 'mongodb';
protected $fillable = [ 'name', 'labels', 'publishable', 'group_id', 'index_policy', 'store_policy', 'get_policy', 'update_policy', 'delete_policy', 'restore_policy', 'trash_policy', 'fields', 'relations' ];
public function indexPolicy() { return $this->belongsTo(PolicyDocument::class, 'index_policy','_id'); } public function storePolicy() { return $this->belongsTo(PolicyDocument::class, 'store_policy','_id'); } public function updatePolicy() { return $this->belongsTo(PolicyDocument::class, 'update_policy','_id'); } public function getPolicy() { return $this->belongsTo(PolicyDocument::class, 'get_policy','_id'); } public function deletePolicy() { return $this->belongsTo(PolicyDocument::class, 'delete_policy','_id'); } public function restorePolicy() { return $this->belongsTo(PolicyDocument::class, 'restore_policy','_id'); } public function trashPolicy() { return $this->belongsTo(PolicyDocument::class, 'trash_policy','_id'); }
}
|