Recent Topics

Scope Laravel



  • 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.



  • Hello @Alex81,

    I am not getting this, may i know what are you trying to do andd where you are calling the methods.



  • @devansh-webkul Hi!
    This is to make a report, but I have already managed to do it, thank you very much.


Log in to reply