public static function getGroupPagePostByID($id) { return GroupPagePost::where('grouppagepostID', $id)->first(); }
public function postDeleteMessage($id) { $in = Input::all(); $check = GroupPage::isAdmin($in['id'], Auth::user()->StudentID) ? true : count(GroupPagePost::getGroupPagePostByID($id)) > 0 ? true : false; $check ? GroupPagePost::where('grouppagepostID', $id)->update(array('delFlag' => 1)) : ''; }