Forum

Multiple account filter in Revenue

Yayınlanan kategoriDevelopment
  • Adarsh Nowlakha    ( User ) 2 years ago

    I need to to filter more than one account in revenue ( not the All Accounts but a few combination of accounts) for that I have made several changes to my files:


     


    In app/Filters/incomes/Revenues.php


        public function account($account)


        {


            foreach ($account as $account) {


              return $this->where('account_id', $account);


    }


        }


     


    In resources/views/incomes/revenues/index.blade.php


                {!! Form::select('account', $accounts, request('account'), ['multiple' => 'true','class' => 'form-control input-filter input-sm']) !!}


    To make the select box into multiple option select box


     


    I am getting a Whoops, looks like something went wrong.


    Please can anyone guide me. Thanks.

  • Wisdom Oppong yeboah    ( User ) 2 years ago

    Adarsh, my guess is $account is not an array, so looping over it won't give you the results you are hoping for.


    To know exactly what went wrong, try setting APP_ENV to development and APP_DEBUG to true in your env file.


    good luck 

  • Adarsh Nowlakha    ( User ) 2 years ago

    Thanks Wisdom Oppong yeboah for advice. I was able to achieve this by creating another select field and filtering revenues using from -to method

Lütfen, cevap vermek için giriş yapın veya kayıt olun.