first commit
This commit is contained in:
40
app/Http/Controllers/HomeController.php
Normal file
40
app/Http/Controllers/HomeController.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user