“Laravel Antara Tanggal” Kode Jawaban

Laravel Antara Tanggal

$from = date('2018-01-01');
$to = date('2018-05-02');

Reservation::whereBetween('reservation_from', [$from, $to])->get();
Nasty Narwhal

Tanggal Laravel antara

$from = date('2018-01-01');
$to = date('2018-05-02');

Reservation::whereBetween('reservation_from', [$from, $to])->get();
Cloudy Caiman

php laravel antara tanggal

namespace App\Http\Controllers;

use App\Mail\CheckUser;
use App\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use PDF;

class TestController extends Controller
{
    public function index()
    {   
       return view('welcome');
    }

    public function daily_report(Request $request)
    {
       $start_date = Carbon::parse($request->start_date)
                             ->toDateTimeString();

       $end_date = Carbon::parse($request->end_date)
                             ->toDateTimeString();

       return User::whereBetween('created_at', [
         $start_date, $end_date
       ])->get();
    }
}
inbloom

Periksa apakah tanggal antara dua tanggal Laravel

<?php 
  //check if date between two dates
$currentDate = date('Y-m-d');
$currentDate = date('Y-m-d', strtotime($currentDate));   
$startDate = date('Y-m-d', strtotime("01/09/2019"));
$endDate = date('Y-m-d', strtotime("01/10/2019"));   
if (($currentDate >= $startDate) && ($currentDate <= $endDate)){   
  echo "Current date is between two dates";
}else{    
  echo "Current date is not between two dates";  
}
//@sujay
$uj@y

Jawaban yang mirip dengan “Laravel Antara Tanggal”

Pertanyaan yang mirip dengan “Laravel Antara Tanggal”

Lebih banyak jawaban terkait untuk “Laravel Antara Tanggal” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya