Answers for "table store date laravel"

PHP
0

where date laravel

$q->whereDate('created_at', '=', date('Y-m-d'));
Posted by: Guest on July-11-2020
1

how set date for do work in laravel

//go to App\Console\Kernel
//for see all run the " php artisan schedule:list "
//for run that run the " php artisan schedule:work "
  
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\DB;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->call(function () {
            DB::table('recent_users')->delete();
        })->daily();
    }
}
Posted by: Guest on June-14-2021

Browse Popular Code Answers by Language