app/Http/ApiControllers/ResultController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {
        $this->offset = isset($request->offset)? $request->offset : 0;
        $this->limit  = isset($request->limit)? $request->limit : 30;
        $student_id;
        if(isset($request->student_id)){
          $student_id = $request->student_id;
        }else{
          $this->setError('404');
          return $this->response('404');
        }
        $result =$this->resultInterface->getAll($this->offset, $this->limit, $student_id);
        $total = $this->resultInterface->total();
        $this->data(ResultResource::collection($result));
        $this->total($total);
        return $this->response('200');
    }
public function index ( Request $ request ) { $ this -> offset = isset ( $ request -> offset ) ? $ request -> offset : 0 ; $ this -> limit = isset ( $ request -> limit ) ? $ request -> limit : 30 ; $ student_id ; if ( isset ( $ request -> student_id ) ) { $ student_id = $ request -> student_id ; } else { $ this -> setError ( '404' ) ; return $ this -> response ( '404' ) ; } $ result = $ this -> resultInterface -> getAll ( $ this -> offset , $ this -> limit , $ student_id ) ; $ total = $ this -> resultInterface -> total ( ) ; $ this -> data ( ResultResource :: collection ( $ result ) ) ; $ this -> total ( $ total ) ; return $ this -> response ( '200' ) ; }
Display a listing of the resource.
Display a listing of the resource .