laravel between dates
$from = date('2018-01-01');
$to = date('2018-05-02');
Reservation::whereBetween('reservation_from', [$from, $to])->get();
laravel between dates
$from = date('2018-01-01');
$to = date('2018-05-02');
Reservation::whereBetween('reservation_from', [$from, $to])->get();
laravel date between
$from = date('2018-01-01');
$to = date('2018-05-02');
Reservation::whereBetween('reservation_from', [$from, $to])->get();
php laravel between dates
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();
}
}
how to get dates between two dates in laravel
// how to get dates between two dates in laravel?
//NOTE => for this you can use Carbon
use Carbon\CarbonPeriod;
$period = CarbonPeriod::create("2020-5-20", "2020-5-30");
foreach ($period as $date) {
// Insert Dates into listOfDates Array
$listOfDates[] = $date->format('Y-m-d');
}
// Now You Can Review This Array
dd($listOfDates);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us