/** * Check if already has advance * Created by smartrahat Date: 2016.02.19 Time: 09:57 AM * @param Request $request * @return string */ public function isAdvance(Request $request) { $eid = $request->get('eid'); $advance = Advance::all()->where('eid', $eid)->where('effect_month', Carbon::now()->subMonth(1)->format('F Y'))->pluck('total')->first(); $warning = $advance != null ? 'This employee already has advance' : ''; return $warning; }
public function isAdvance($eid) { return Advance::all()->where('eid', $eid)->where('effect_month', Carbon::now()->subMonth(1)->format('F Y'))->pluck('total')->first(); }