Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get last 30 days records in laravel

use CarbonCarbon;

$users = DB::table("users")
    ->select('id')
    ->where('accounttype', 'standard')
    ->where('created_at', '>', now()->subDays(30)->endOfDay())
    ->all();
Comment

get data of last 7 days in laravel

$date = Carbon::now()->subDays(7);
$users = User::where('created_at', '>=', $date)->get();
dd($users);

Comment

PREVIOUS NEXT
Code Example
Php :: laravel long description text string 
Php :: how to get browser info in php 
Php :: start server symfony command 
Php :: laravel make model with migration and controller 
Php :: styling not working in laravel breeze 
Php :: laravel test assert redirecto to 
Php :: laravel create project in current directory 
Php :: hide wordpress errors 
Php :: php delete element by value 
Php :: check if logged laravel 
Php :: wp-config override site url 
Php :: PHP extension simplexml 
Php :: php mysql date 
Php :: php get hostname 
Php :: typo3 debug 
Php :: laravel convert datetime to date 
Php :: laravel make migration controller resource mcr 
Php :: flutter boxdecoration add border 
Php :: how to use bootstrap in laravel 8 remove tailwind 
Php :: codeigniter 3 insert 
Php :: laravel check if eloquent just created 
Php :: running laravel as host 
Php :: php array to console 
Php :: add zeros in front of number php 
Php :: How to change add to cart button in wordpress 
Php :: python truncate file contents 
Php :: unique value when two columns laravel migration 
Php :: ext-dom php 7.2 
Php :: get file each line in php 
Php :: how if charactor is exist in text in laravel 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =