2

I am trying to use BETWEEN with laravel query builder. How do I do it. I have tried this below

Eventcalender::where(['between', 'acceptance_date', $final, $time])->count();
1
  • I don't think you can use 'between' like this. Instead, use whereBetween. Check the Laravel doc here: laravel.com/docs/6.x/queries Commented Jan 7, 2020 at 8:40

1 Answer 1

6

Check hist out: whereBetween()

The whereBetween method verifies that a column's value is between two values,

For Eloquent:

Eventcalender::whereBetween('acceptance_date', [$final, $time])->count();

For Query Builder:

DB::table('eventcalenders')->whereBetween('acceptance_date', [$final, $time])->count();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.