Answers for "laravel belongsto with condition date"

PHP
0

laravel belongsto with condition date

Model::with(['relationMethod'=>function($query){
            return $query->where('pwra_dt', date('Y-m-d'))->get();

        }]) ->get();
Posted by: Guest on February-11-2022
0

laravel belongsto with condition date

public function pwra()
{
    return $this->belongsTo('AppModelsPwra', 'pwra_uuid', 'pwra_uuid')
      ->where('pwra_dt', '>=', Carbon::today())
      ->where('pwra_dt', '<', Carbon::tomorrow());
}
Posted by: Guest on February-11-2022

Code answers related to "laravel belongsto with condition date"

Browse Popular Code Answers by Language