<?php
namespace App\Repositories;

use App\Work;
use App\Type;
use DB;
use Response;

class WorksRepository {


  /**
  * Queries database for all works based on catID
  *
  */
    public function getallworks($catID) {

      return Work::join('types','works.typeID','=','types.typeID')
      ->select('workID','catID','contentType','expectedFields','url','info','tags')
      ->where('catID','=',$catID)
      ->where('approved',true)
      ->get();

    }


    /**
    * Will display all works for a category that satisfy query.
    *
    * @return Response
    */
    public function retrieve($catID, $infos, $tags)
    {

    return  $worksfromcat = Work::join('types','works.typeID','=','types.typeID')
      ->select('workID','catID','contentType','expectedFields','url','info','tags')
      ->where('catID','=',$catID)
      ->where('approved',true)
      ->where(function($query) use ($infos){



      })
      ->where(function($query) use ($tags){

          foreach ($tags as $tag)
          {
            $query->whereRaw("exist(tags, ?)", array($tag));
            
          }


        })
      ->get();

    }


    /**
    * Retrieve Tags from parameters.
    *
    * @return Response
    */
    public function parsetags($params)
    {

    return $params['tags'];

    }

}

?>

<?php
namespace App\Repositories;

use App\Work;
use App\Type;
use DB;
use Response;

class WorksRepository {


  /**
  * Queries database for all works based on catID
  *
  */
    public function getallworks($catID) {

      return Work::join('types','works.typeID','=','types.typeID')
      ->select('workID','catID','contentType','expectedFields','url','info','tags')
      ->where('catID','=',$catID)
      ->where('approved',true)
      ->get();

    }


    /**
    * Will display all works for a category that satisfy query.
    *
    * @return Response
    */
    public function retrieve($catID, $infos, $tags)
    {

    return  $worksfromcat = Work::join('types','works.typeID','=','types.typeID')
      ->select('workID','catID','contentType','expectedFields','url','info','tags')
      ->where('catID','=',$catID)
      ->where('approved',true)
      ->where(function($query) use ($infos){


        // Info search, not currently implemented



      })
      ->where(function($query) use ($tags){

          foreach ($tags as $tag)
          {
            $query->whereRaw("exist(tags, ?)", array($tag));

          }


        })
      ->get();

    }


    /**
    * Retrieve Tags from parameters.
    *
    * @return Response
    */
    public function parsetags($params)
    {

    return $params['tags'];

    }

}

?>

Add a statement that info search is not currently implemented
Add a statement that info search is not currently implemented
