public function askJoin($id) { $check = GroupPageJoin::where('grouppageID', $id)->where('StudentID', Auth::user()->StudentID)->where('delFlag', 0)->first(); if (!$check) { GroupPageJoin::create(['grouppageID' => $id, 'StudentID' => Auth::user()->StudentID]); } }
public static function isRequested($id) { $check = GroupPageJoin::where('grouppageID', $id)->where('StudentID', Auth::user()->StudentID)->where('delFlag', 0)->first(); return $check ? true : false; }