StocksNew/app/Http/Controllers/HomeController.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

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()
{
}
}