Files
backend_vib360_laravel/app/Models/UserAssetLink.php

29 lines
511 B
PHP
Raw Permalink Normal View History

2025-03-11 17:15:41 +05:30
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class UserAssetLink extends Model
{
use HasFactory;
2025-03-11 19:05:25 +05:30
protected $table = 'user_asset_link';
2025-03-11 17:15:41 +05:30
protected $fillable = [
'user_id',
'asset_id',
];
2025-03-11 19:05:25 +05:30
public function asset()
2025-03-11 17:15:41 +05:30
{
2025-03-11 19:05:25 +05:30
return $this->belongsTo(Asset::class, 'asset_id', 'id');
2025-03-11 17:15:41 +05:30
}
2025-03-11 19:05:25 +05:30
public function user()
2025-03-11 17:15:41 +05:30
{
2025-03-11 19:05:25 +05:30
return $this->belongsTo(User::class, 'user_id', 'id');
2025-03-11 17:15:41 +05:30
}
}