skip to Main Content

Highlight row if has duplicate value – Laravel

Hello I have these columns 'name', 'email', 'username' and 'ip' how would I check or highlight table row in blade if records has same ip? This is my controller $promo = Promo::with(['participants' => function ($q) { $q->orderBy('winner', 'desc')->orderBy('created_at', 'desc'); }])->find($id);…

VIEW QUESTION

How to add object in laravel relationships

How to add extra object in laravel relationship when fatch data. Here is my code: $list = new self; $list = $list->where('uuid', $uuid); $list = $list->where('user_id', $user->id)->orWhere('to_user_id', $user->id); $list = $list->with(['touser' => function($q1) { $q1 = $q1->select('id', 'name', 'email', 'user_image',…

VIEW QUESTION

How to get data from Laravel relation

I have 2 models: publictxt and Pulicetxtrecive publictxt model: class Publictxt extends Model { protected $fillable=['sender','reciver','description','useridseen']; public function Publictxtrecives() { return $this->hasMany(Pulicetxtrecive::class,'publictxt_id', 'id'); } } Pulicetxtrecive model: protected $fillable=['publictxt_id','user_id','seen']; public function publictxts() { return $this->belongsTo(Publictxt::class); } I want to get…

VIEW QUESTION
Back To Top
Search