Edit File: Complain.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Complain extends Model { use HasFactory; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['user_id' , 'subject' , 'text' , 'src' , 'phone' , 'status' , 'showOrNow']; protected $table = 'complains'; protected $guarded = []; public function user() { return $this->belongsTo(User::class); } public function markAsRead() { $this->update(['showOrNow' => 1]); } }
Back to File Manager