Locker\Repository\Base\EloquentRepository::show PHP Method

show() public method

Gets the model with the given ID and options.
public show ( String $id, array $opts ) : Model
$id String ID to match.
$opts array
return Illuminate\Database\Eloquent\Model
    public function show($id, array $opts)
    {
        $model = $this->where($opts)->where('_id', $id)->first();
        if ($model === null) {
            throw new Exceptions\NotFound($id, $this->model);
        }
        return $this->format($model);
    }

Usage Example

 /**
  * Converts foreign ids to MongoIds, then
  * gets the model with the given ID and options.
  * @param String $id ID to match.
  * @param [String => Mixed] $opts
  * @return Model
  */
 public function show($id, array $opts)
 {
     $opts['lrs_id'] = new \MongoId($opts['lrs_id']);
     return parent::show($id, $opts);
 }