Skip to content

Instantly share code, notes, and snippets.

@salipro4ever
Created July 26, 2018 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salipro4ever/106ee0f0a12100cc71dfdd879414c02c to your computer and use it in GitHub Desktop.
Save salipro4ever/106ee0f0a12100cc71dfdd879414c02c to your computer and use it in GitHub Desktop.
Laravel notes

$results = Stock::whereHas('receiptNotes',function ($query) { $query->where('status', 'approved'); })->where(function ($query) use ($q) { $query->where('name','like',"%$q%")->orWhere('code','like',"%$q%"); })->limit(10)->get();

    #salipro: bug laravel, khong hoat dong neu nhu the nay
        //->where('name','like',"%$q%")
        //->orWhere('code','like',"%$q%")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment