Laravel: Eloquent 'Tricks' to Query Dates from DB

preview_player
Показать описание
What if you need to query users who registered today or yesterday? Or this month? There are a few Eloquent and Carbon helpers for these queries.

- - - - -
Рекомендации по теме
Комментарии
Автор

Thank you much for the information it's really helpful but how do you query weekly data ?

ntendenirazwinani
Автор

That was cool. I don't know about these functions. Till now I was using the first way that you show on the start of the video.
From now I will use the first function for sure. Rest of them based on the criteria.
Thanks guys 😍😍❤️❤️

ajithlal
Автор

Very useful as always! Thanks.
I always queried with ->where('created_at', now()->toDateString())... but your Version is much better! Thanks!

sunnysk
Автор

Very helpful and informative. Thanks 😊 Gradually becoming your fan.

SouravTah
Автор

Hi Dear,
i have a simple question about queries and dates: for example how can i get with one query total of posts today/week/month ?
thanks a lot.

rachidimohamed
Автор

WhereDate is not used mysql index if you have one

MrRsVijay
Автор

Hello Mr.! Your video is very good but I have a question. How do I get results from a query like this: $res = DB::table('posts')->join('users', 'users.id', '=', 'posts.user_id' )->select('users.id', 'posts.title', 'posts.subject', 'posts.updated_at' )->get(); and have a format like ('d/m/Y') at the 'updated_at' in the results? I do not want to show the results in a blade view. I need that date format in the results. Is there a possible way? Thanks!

fabianogs
Автор

I have a table named as "basicinfo" and a column in database named as "dateOfEnrollment" with type as date. I want to query all the records that are enrolled for more than 4 years. How i can do that ?

muhammadhassantariq
Автор

i am using Jetstream with livewire and there is jet component called dialog modal i want increase it width how can i do please help

mantoshnishad
Автор

you plzzz make the videos relationship course. I have knowledge but where do I start so u proper one project work in Laravel and about the standard code for the project . I like your coding pattern
Thanks

MuhammadFarhan-dyol
Автор

Hi Povilas! Do you can tell how i can use Laravel completly without laravel eloquent query builder! I want to use RAW SQL language for building database queries for laravel models.. this will work much faster, you can practice in RAW SQL syntax, you dont need to learn and to use a software (eloquent) between you and database, you will speak to DB derectly.

HDKinoCool
Автор

i change today() to yesterday() but it gives error

joymasaya
Автор

Hey Povilas,
Can you help me setup bkwld\cloner package

charanarora
Автор

Thanks mr. Please tell me how can I use jQuery ui in laravel 7.2 with cdn. I don't want to install.
Thanks in advance

tahinuralam
Автор

Could you please Mr make a vedio about multi auth (more than 3 types of users)

abdellatifettagdouini