31 lines
		
	
	
		
			593 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			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
 | |
| }
 |