I have an attendance system, now I want to compare the date of the day to the date in the database, I have my date in the database in Timestamp format, now what I only need is the date and the year, I want to compare it to the current date, Here is my code:
$userinput=Input::get('empid');
$mydate=Carbon::now()->addHours(8);
$newdate=$mydate->toDateString();
if ($newdate==$datefromdatabaseifexist)
{
}
else
DB::table('attendances')->insert(
array('user_id' => $userinput, 'logon' =>$newdate)
);