Hello, it's a pleasure to greet everyone in the forum.
I would like to know how I can use Laravel's Scope function in Bagisto, since I have tried to use it normally to make reports and it generates this error.
TypeError thrown with message "Argument 1 passed to Symfony \ Component \ HttpFoundation \ Response :: setContent () must be of the type string or null, object given, called in J: \ xampp \ htdocs \ bagisto \ vendor \ laravel \ framework \ src \ Illuminate \ Http \ Response.php on line 65 "
Model:
public function scopeAccountPeriod($query, $period)
{
if ($period != '') {
$sdate = Carbon::parse('last monday')->subWeek(1)->toDateString();
$edate = Carbon::parse('last monday')->toDateString();
return $result = $query->whereBetween('account_pays.created_at', [$sdate,$edate])->orderby('account_pays.id', 'DESC');
}
}
Beforehand thank you very much.