Files
Global-Jain/app/Models/UserBlocked.php
2025-11-05 10:37:10 +05:30

51 lines
966 B
PHP

<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class UserBlocked extends Model
{
use HasFactory;
protected $table = 'user_blocked';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id',
'blocked_by'
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'user_id' => 'integer',
'blocked_by' => 'integer',
];
/**
* Get the user whose profile has been blocked.
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
/**
* Get the user that blocked the profile.
*/
public function blockedBy()
{
return $this->belongsTo(User::class, 'blocked_by');
}
}