Laravel where clause with date_format() exampleBy Hardik Savani | June 22, 2016 | | 7152 Viewer | Category : Laravel
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")
- Codeigniter 3 and AngularJS CRUD with Search and Pagination Example.
- Codeigniter - How to get current url in controller or view ?
- How to make simple dependent dropdown using jquery ajax in Laravel 5?
- PHP Laravel 5 - Sub-domain routing file Example
- AngularJS - How to call function on page load example with demo?
- How to count number of files in directory PHP?
- Ajax Image Upload using PHP and jQuery Example from scratch
- Laravel 5 - user prevent common passwords using laravel-password package