What do you want to save?
Add Code snippet
New code examples
-
PHP 2022-03-04 20:50:12
laravel eloquent get 3 months
$dateS = Carbon::now()->startOfMonth()->subMonth(3); $dateE = Carbon::now()->startOfMonth(); $TotalSpent = DB::table('orders') ->select('total_cost','placed_at') ->whereBetween('placed_at',[$dateS,$dateE]) ->where(['deleted' => '0', ... Add solution -
PHP 2021-11-13 07:57:15
logout all users laravel 8
for database session I am updating all users remember tokens to blank and then flushing stored session by truncate the sessions table. DB::table('users')->update(array( 'remember_token' => '', 'logout_at' => Carbon::now()->toDateTi... Add solution -
PHP 2021-11-08 09:24:21
how to calculate age in laravel
use Carbon\Carbon; // Include Class in COntroller $request->date_of_birth = "2000-10-25"; $age = Carbon::parse($request->date_of_birth)->diff(Carbon::now())->y; dd($age. " Years"); // To check result Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5