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

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 or One required filed in Laravel validation

snippet

Preview Laravel Mailable's Blade template

snippet

Laravel Blade Remove the Last Comma from Foreach Loop

snippet

Create dynamic model name in livewire 3

snippet
Random Stories

Laravel Queue with Parameters Step by Step Example

snippet

How to copy past data from clipboard in windows to virtual box Linux

snippet

Laravel Custom mapToRedirect Route Macro

snippet

How to use paginator in Laravel API resources by default

snippet

onChange select2 in livewire 3 dose not working

snippet