StocksNew/app/Http/Controllers/HomeController.php

41 lines
847 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace App\Http\Controllers;
use Modules\Attendance\Models\Attendance;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
$data['isClockIn'] = true;
$attendance = Attendance::where('employee_id', auth()->user()->employee_id)->whereDate('date', now())->first();
if ($attendance) {
if ($attendance->type == 'clockout') {
$data['isClockIn'] = false;
}
}
return view('dashboard', $data);
}
public function employeeDashboard()
{
}
}