41 lines
847 B
PHP
41 lines
847 B
PHP
|
<?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()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
}
|