How to query multiple whereMonth in orWhere query for laravel












1














I'm newbie in Laravel and I need to do laravel query by getting result like below sql.



(SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and (month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12)))


Below is Laravel code that I use.



                    $participate = ProjectParticipate::where('project_id' , $project->project_id)
->where('department_id', $auth->department_id)
->whereMonth('created_at' , 10)
->orWhere(function($query){$query->whereMonth('created_at',11); })
->orWhere(function($query1){$query1->whereMonth('created_at',12); })
->get();


And I have result as below, that is not a query that I want.



(SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12))


Appreciated for advice how to write Laravel query to get result as whsh, And so sorry for my English. Thank you very much.










share|improve this question



























    1














    I'm newbie in Laravel and I need to do laravel query by getting result like below sql.



    (SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and (month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12)))


    Below is Laravel code that I use.



                        $participate = ProjectParticipate::where('project_id' , $project->project_id)
    ->where('department_id', $auth->department_id)
    ->whereMonth('created_at' , 10)
    ->orWhere(function($query){$query->whereMonth('created_at',11); })
    ->orWhere(function($query1){$query1->whereMonth('created_at',12); })
    ->get();


    And I have result as below, that is not a query that I want.



    (SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12))


    Appreciated for advice how to write Laravel query to get result as whsh, And so sorry for my English. Thank you very much.










    share|improve this question

























      1












      1








      1







      I'm newbie in Laravel and I need to do laravel query by getting result like below sql.



      (SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and (month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12)))


      Below is Laravel code that I use.



                          $participate = ProjectParticipate::where('project_id' , $project->project_id)
      ->where('department_id', $auth->department_id)
      ->whereMonth('created_at' , 10)
      ->orWhere(function($query){$query->whereMonth('created_at',11); })
      ->orWhere(function($query1){$query1->whereMonth('created_at',12); })
      ->get();


      And I have result as below, that is not a query that I want.



      (SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12))


      Appreciated for advice how to write Laravel query to get result as whsh, And so sorry for my English. Thank you very much.










      share|improve this question













      I'm newbie in Laravel and I need to do laravel query by getting result like below sql.



      (SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and (month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12)))


      Below is Laravel code that I use.



                          $participate = ProjectParticipate::where('project_id' , $project->project_id)
      ->where('department_id', $auth->department_id)
      ->whereMonth('created_at' , 10)
      ->orWhere(function($query){$query->whereMonth('created_at',11); })
      ->orWhere(function($query1){$query1->whereMonth('created_at',12); })
      ->get();


      And I have result as below, that is not a query that I want.



      (SQL: select * from `tb_project_participate` where `project_id` = 20 and `department_id` = 1 and month(`created_at`) = 10 or (month(`created_at`) = 11) or (month(`created_at`) = 12))


      Appreciated for advice how to write Laravel query to get result as whsh, And so sorry for my English. Thank you very much.







      laravel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 9:44









      Chaiwat JoChaiwat Jo

      336




      336
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Please google it first and foremost. I think this question has been answered tens of times on stackoverflow and hundreds or times on the web.



          Try this:



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->where(function($query){
          $query->whereMonth('created_at' , 10);
          $query->orWhere(function($query2){
          $query2->whereMonth('created_at',11); });
          $query->orWhere(function($query1){
          $query1->whereMonth('created_at',12); });
          })->get();


          Or this (recomended):



          We try to make code as general as possible so I want the months as a paramater.
          No real reason for $auth either, since it's an extra operation to do: $auth = Auth::user(). Just use Auth::user()



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', Auth::user()->department_id)
          ->where(DB::RAW('month(created_at)'), $months)
          ->get();


          Where $months is this array: [10,11,12]



          Basically we have a query where we add all the or statements in.
          Check the manual for reference. You didn't mention the version, but not much change has been done in the last 3 years so here is the latest version: https://laravel.com/docs/5.7/queries#parameter-grouping






          share|improve this answer





















          • Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
            – Chaiwat Jo
            Nov 12 '18 at 10:25










          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05



















          2














          try something like this



           $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereRaw('month(created_at) in (10,11,12))
          ->get()


          or you can also do as



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereIn(DB::raw('month(created_at)'),[10,11,12])
          ->get()





          share|improve this answer





















          • Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
            – Chaiwat Jo
            Nov 12 '18 at 10:20












          • instead using multiple or condition we can use in condition right?
            – Jayashree
            Nov 12 '18 at 10:28










          • select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
            – Jayashree
            Nov 12 '18 at 10:29












          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259450%2fhow-to-query-multiple-wheremonth-in-orwhere-query-for-laravel%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Please google it first and foremost. I think this question has been answered tens of times on stackoverflow and hundreds or times on the web.



          Try this:



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->where(function($query){
          $query->whereMonth('created_at' , 10);
          $query->orWhere(function($query2){
          $query2->whereMonth('created_at',11); });
          $query->orWhere(function($query1){
          $query1->whereMonth('created_at',12); });
          })->get();


          Or this (recomended):



          We try to make code as general as possible so I want the months as a paramater.
          No real reason for $auth either, since it's an extra operation to do: $auth = Auth::user(). Just use Auth::user()



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', Auth::user()->department_id)
          ->where(DB::RAW('month(created_at)'), $months)
          ->get();


          Where $months is this array: [10,11,12]



          Basically we have a query where we add all the or statements in.
          Check the manual for reference. You didn't mention the version, but not much change has been done in the last 3 years so here is the latest version: https://laravel.com/docs/5.7/queries#parameter-grouping






          share|improve this answer





















          • Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
            – Chaiwat Jo
            Nov 12 '18 at 10:25










          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05
















          1














          Please google it first and foremost. I think this question has been answered tens of times on stackoverflow and hundreds or times on the web.



          Try this:



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->where(function($query){
          $query->whereMonth('created_at' , 10);
          $query->orWhere(function($query2){
          $query2->whereMonth('created_at',11); });
          $query->orWhere(function($query1){
          $query1->whereMonth('created_at',12); });
          })->get();


          Or this (recomended):



          We try to make code as general as possible so I want the months as a paramater.
          No real reason for $auth either, since it's an extra operation to do: $auth = Auth::user(). Just use Auth::user()



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', Auth::user()->department_id)
          ->where(DB::RAW('month(created_at)'), $months)
          ->get();


          Where $months is this array: [10,11,12]



          Basically we have a query where we add all the or statements in.
          Check the manual for reference. You didn't mention the version, but not much change has been done in the last 3 years so here is the latest version: https://laravel.com/docs/5.7/queries#parameter-grouping






          share|improve this answer





















          • Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
            – Chaiwat Jo
            Nov 12 '18 at 10:25










          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05














          1












          1








          1






          Please google it first and foremost. I think this question has been answered tens of times on stackoverflow and hundreds or times on the web.



          Try this:



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->where(function($query){
          $query->whereMonth('created_at' , 10);
          $query->orWhere(function($query2){
          $query2->whereMonth('created_at',11); });
          $query->orWhere(function($query1){
          $query1->whereMonth('created_at',12); });
          })->get();


          Or this (recomended):



          We try to make code as general as possible so I want the months as a paramater.
          No real reason for $auth either, since it's an extra operation to do: $auth = Auth::user(). Just use Auth::user()



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', Auth::user()->department_id)
          ->where(DB::RAW('month(created_at)'), $months)
          ->get();


          Where $months is this array: [10,11,12]



          Basically we have a query where we add all the or statements in.
          Check the manual for reference. You didn't mention the version, but not much change has been done in the last 3 years so here is the latest version: https://laravel.com/docs/5.7/queries#parameter-grouping






          share|improve this answer












          Please google it first and foremost. I think this question has been answered tens of times on stackoverflow and hundreds or times on the web.



          Try this:



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->where(function($query){
          $query->whereMonth('created_at' , 10);
          $query->orWhere(function($query2){
          $query2->whereMonth('created_at',11); });
          $query->orWhere(function($query1){
          $query1->whereMonth('created_at',12); });
          })->get();


          Or this (recomended):



          We try to make code as general as possible so I want the months as a paramater.
          No real reason for $auth either, since it's an extra operation to do: $auth = Auth::user(). Just use Auth::user()



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', Auth::user()->department_id)
          ->where(DB::RAW('month(created_at)'), $months)
          ->get();


          Where $months is this array: [10,11,12]



          Basically we have a query where we add all the or statements in.
          Check the manual for reference. You didn't mention the version, but not much change has been done in the last 3 years so here is the latest version: https://laravel.com/docs/5.7/queries#parameter-grouping







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 '18 at 10:15









          IndraIndra

          446313




          446313












          • Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
            – Chaiwat Jo
            Nov 12 '18 at 10:25










          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05


















          • Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
            – Chaiwat Jo
            Nov 12 '18 at 10:25










          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05
















          Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
          – Chaiwat Jo
          Nov 12 '18 at 10:25




          Hi, It should be a query like .... where a =1 and (b = 0 or c= 0 or d = 0) not .....where a =1 and b = 0 or c= 0 or d = 0
          – Chaiwat Jo
          Nov 12 '18 at 10:25












          Thank you very much.
          – Chaiwat Jo
          Nov 12 '18 at 11:05




          Thank you very much.
          – Chaiwat Jo
          Nov 12 '18 at 11:05













          2














          try something like this



           $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereRaw('month(created_at) in (10,11,12))
          ->get()


          or you can also do as



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereIn(DB::raw('month(created_at)'),[10,11,12])
          ->get()





          share|improve this answer





















          • Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
            – Chaiwat Jo
            Nov 12 '18 at 10:20












          • instead using multiple or condition we can use in condition right?
            – Jayashree
            Nov 12 '18 at 10:28










          • select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
            – Jayashree
            Nov 12 '18 at 10:29












          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05
















          2














          try something like this



           $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereRaw('month(created_at) in (10,11,12))
          ->get()


          or you can also do as



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereIn(DB::raw('month(created_at)'),[10,11,12])
          ->get()





          share|improve this answer





















          • Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
            – Chaiwat Jo
            Nov 12 '18 at 10:20












          • instead using multiple or condition we can use in condition right?
            – Jayashree
            Nov 12 '18 at 10:28










          • select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
            – Jayashree
            Nov 12 '18 at 10:29












          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05














          2












          2








          2






          try something like this



           $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereRaw('month(created_at) in (10,11,12))
          ->get()


          or you can also do as



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereIn(DB::raw('month(created_at)'),[10,11,12])
          ->get()





          share|improve this answer












          try something like this



           $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereRaw('month(created_at) in (10,11,12))
          ->get()


          or you can also do as



          $participate = ProjectParticipate::where('project_id' , $project->project_id)
          ->where('department_id', $auth->department_id)
          ->whereIn(DB::raw('month(created_at)'),[10,11,12])
          ->get()






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 '18 at 9:50









          JayashreeJayashree

          635




          635












          • Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
            – Chaiwat Jo
            Nov 12 '18 at 10:20












          • instead using multiple or condition we can use in condition right?
            – Jayashree
            Nov 12 '18 at 10:28










          • select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
            – Jayashree
            Nov 12 '18 at 10:29












          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05


















          • Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
            – Chaiwat Jo
            Nov 12 '18 at 10:20












          • instead using multiple or condition we can use in condition right?
            – Jayashree
            Nov 12 '18 at 10:28










          • select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
            – Jayashree
            Nov 12 '18 at 10:29












          • Thank you very much.
            – Chaiwat Jo
            Nov 12 '18 at 11:05
















          Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
          – Chaiwat Jo
          Nov 12 '18 at 10:20






          Hi this is wrong query, the equivalent to sql => select * from tb_project_participate where project_id = 20 and department_id = 1 and month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12). ...........................................................................................But I need like select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12))
          – Chaiwat Jo
          Nov 12 '18 at 10:20














          instead using multiple or condition we can use in condition right?
          – Jayashree
          Nov 12 '18 at 10:28




          instead using multiple or condition we can use in condition right?
          – Jayashree
          Nov 12 '18 at 10:28












          select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
          – Jayashree
          Nov 12 '18 at 10:29






          select * from tb_project_participate where project_id = 20 and department_id = 1 and (month(created_at) = 10 or (month(created_at) = 11) or (month(created_at) = 12)) is equivalent to ProjectParticipate::where('project_id' , $project->project_id)->where('department_id', $auth->department_id)->where(function($query){$query->whereMonth('created_at',10)->orWhere(DB::raw('month(created_at)'),11)->orWhere(DB::raw('month(created_at)'),12)})->get();
          – Jayashree
          Nov 12 '18 at 10:29














          Thank you very much.
          – Chaiwat Jo
          Nov 12 '18 at 11:05




          Thank you very much.
          – Chaiwat Jo
          Nov 12 '18 at 11:05


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259450%2fhow-to-query-multiple-wheremonth-in-orwhere-query-for-laravel%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Full-time equivalent

          さくらももこ

          13 indicted, 8 arrested in Calif. drug cartel investigation