• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Scope Laravel

General Discussion
2
3
445
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    Alex81 last edited by 25 Aug 2020, 18:42

    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.

    1 Reply Last reply Reply Quote 0
    • devansh-webkul
      devansh-webkul last edited by 26 Aug 2020, 13:12

      Hello @Alex81,

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

      A 1 Reply Last reply 26 Aug 2020, 13:44 Reply Quote 0
      • A
        Alex81 @devansh-webkul last edited by 26 Aug 2020, 13:44

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

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post