Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php laravel between dates

namespace AppHttpControllers;

use AppMailCheckUser;
use AppUser;
use CarbonCarbon;
use IlluminateHttpRequest;
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();
    }
}
Source by www.codecheef.org #
 
PREVIOUS NEXT
Tagged: #php #laravel #dates
ADD COMMENT
Topic
Name
3+2 =