Laravel where clause with date_format() exampleBy Hardik Savani | June 22, 2016 | | 2011 Viewer | Category : Laravel
Share this post:
In this post, i share with you that how to use date_format() with where condition of Laravel query builder. When i was working on my project, i require to search with get only selected month and year records from created_at(timestamp) column. I was thinking how can i but i know date_format() of mysql. but don't know how to use in laravel where clause. At last i use DB::raw() of Laravel and it's work.
If you have also need to search this way then you can do it this way:
$data = DB::table("items")
- How to increase throttle lockout time and max Login Attempts in Laravel 5?
- Codeigniter - How to get current url in controller or view ?
- Jquery - draggable sortable table rows example demo with bootstrap
- How to remove undefined value from jquery array?
- PHP - How to make dependent dropdown list using jquery Ajax?
- How to fetch this week records in MySql ?
- How to create snippets in sublime ?
- Laravel 5.3 - whereDate(), whereMonth(), whereDay() and whereYear() examples.