Answers for "laravel date time"

PHP
13

laravel date set timezone

edit /config/app.php
'timezone' => 'Asia/Dhaka'
Posted by: Guest on October-31-2020
5

datetime format laravel

//laravel method 1
{{ $data->created_at->isoFormat('dddd D') }}

//laravel method 2 
{!! date('d/M/y', strtotime($data->created_at)) !!}
Posted by: Guest on August-08-2020
1

format time laravel

{{\Carbon\Carbon::createFromFormat('H:i:s',$time)->format('h:i')}}

{{$item->date_seance->format('d/m/Y') }}

{{date('H:i', strtotime($item->start_time)) }}
Posted by: Guest on February-20-2021
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
0

date time laravel

'phone' => 'required|regex:/(01)[0-9]{9}/'
Posted by: Guest on October-24-2021

Browse Popular Code Answers by Language