app/Http/ApiControllers/ActivityController.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;
         $name         = isset($request->name)? $request->name : '%';
         $speaker      = isset($request->speaker)? $request->speaker : '%';
         $type='';
         if (!isset($request->type)) {
            $type="%";
            $total = $this->activityInterface->total(3);
         }else{
           $type = $this->convertPostType($request->type, '%');
           $total = $this->activityInterface->total($type);
         }
         $activity = ActivityResource::collection($this->activityInterface->getAll($this->offset, $this->limit, $name, $speaker, $type));
         $total = $this->activityInterface->total($type);
         $this->total($total);
         $this->data($activity);
         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 ; $ name = isset ( $ request -> name ) ? $ request -> name : '%' ; $ speaker = isset ( $ request -> speaker ) ? $ request -> speaker : '%' ; $ type = '' ; if ( ! isset ( $ request -> type ) ) { $ type = " % " ; $ total = $ this -> activityInterface -> total ( 3 ) ; } else { $ type = $ this -> convertPostType ( $ request -> type , '%' ) ; $ total = $ this -> activityInterface -> total ( $ type ) ; } $ activity = ActivityResource :: collection ( $ this -> activityInterface -> getAll ( $ this -> offset , $ this -> limit , $ name , $ speaker , $ type ) ) ; $ total = $ this -> activityInterface -> total ( $ type ) ; $ this -> total ( $ total ) ; $ this -> data ( $ activity ) ; return $ this -> response ( '200' ) ; }
Display a listing of the resource.
Display a listing of the resource .
// dd($type);