File: D:/HostingSpaces/SBogers10/rentman.komma.pro/app/Komma/Tables/TableService.php
<?php
namespace Komma\Tables;
use Illuminate\Support\Collection;
use Komma\Images\ImageService;
use Komma\Tables\Models\Table;
/**
*
* @author Komma <support@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
class TableService
{
/**
* This method gets the prices with an IN
*
* @param $field | string, field for the in
* @param $values | array, values for the in
* @return mixed
*/
public function getTableIn($field, $values)
{
//Only get the active blocks
$tables = Table::where('active', '=', 1)
//Where in with field and values
->whereIn($field, $values)
//Also load the translation
->with('translation')
->get()
->keyBy($field);
return $tables;
}
/**
* This method gets the tables where
*
* @param $field | string, field for the where
* @param $values | array, value for the where
* @return mixed
*/
public function getTablesWhere($field, $values)
{
//Only get the active blocks
$tables = Table::where('active', '=', 1)
//Where field is value
->where($field, '=', $values)
//Also load the translation
->with('translation')
->get();
return $tables;
}
}