logo logo
  • Articles
  • Snippets
  • Topics
    • Login
    • Register

    • Mode:

In Laravel (AND) OR (AND) Query

  • Jan 31, 2023
  • Snippet ยท 1 min
  • 68 words
  • Share profile in a message
  • Save your profile to PDF
  • Lock profile

  • Profile settings
  • Like (0)
  • Favorite (0)

I will give you the short way how to do that. This will available after Larave 5.3. Checkout the below,

$data = Model::where([
	['column_name_1', '>', '1'],
	['column_name_2', '>', '1'],
])
->orWhere([
	['column_name_1', '<', '1'],
	['column_name_2', '<', '1'],
])
->get();

Laravel
avatar
Md Najmul Hasan

Similar Stories

Laravel 10 Usage of latest() for Eloquent Queries

snippet

Create dynamic model name in livewire 3

snippet

Getting error to install php artisan ui react --auth for Laravel react ui the error is Could not resolve dependency: peer vite@"^3.0.0" from @vitejs/[email protected]

snippet

Two way to upload file in Laravel

snippet

Did you forget to use the [uses()] function? get this error after install pest in laravel

snippet
Random Stories

JavaScript Check Value is Undefined

snippet

How to create Laravel single table migrate

snippet

JavaScript How Object.is() Method Works

snippet

Python Find the Largest Among 3 Numbers

snippet

How to validation with custom message in controller of Laravel

snippet