App\Http\Controllers\NoticesController::check PHP Method

check() public method

public check ( $id )
    public function check($id = 0)
    {
        $request = \Request::all();
        if ($id) {
            Notice::auth()->find($id)->update(['status' => 'read']);
        } elseif (isset($request['date'])) {
            Notice::auth()->ofStatus('new')->before($request['date'])->update(['status' => 'unread']);
        }
        $this->push(true);
    }