20 lines
450 B
PHP
20 lines
450 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class RenderTracker extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public function targetObj()
|
|
{
|
|
if($this->type == 'user2d' || $this->type == 'user3d')
|
|
return $this->belongsTo(User::class, 'target');
|
|
elseif($this->type == 'asset2d' || $this->type == 'asset3d')
|
|
return $this->belongsTo(Asset::class, 'target');
|
|
}
|
|
}
|