Aplikasi_Rekber/app/Models/NotificationReceiver.php
2023-11-27 09:06:28 +07:00

31 lines
593 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class NotificationReceiver extends Model
{
use HasFactory;
protected $fillable = [
'notification_id',
'receiver',
];
protected $casts = [
'id' => 'string',
];
//Relasi
public function data_receiver(){
return $this->belongsTo(User::class, 'receiver', 'email');
}
public function notifications(){
return $this->belongsTo(Notification::class, 'notification_id', 'id');
}
//Relasi
}