ldc-legaulois/app/Models/BlockList.php
2026-09-25 16:25:31 +02:00

37 lines
758 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class BlockList extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'customer_id',
'blocked_id',
];
// * RELATIONSHIPS
/**
* Get the associated customer who has blocked another one.
*/
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
/**
* Obtain the associated client that has been blocked by another one.
*/
public function blocked(): BelongsTo
{
return $this->belongsTo(Customer::class, 'blocked_id');
}
}