Esempio n. 1
0
 /**
  * Validate the uniqueness of an attribute value on a given database table.
  *
  * If a database column is not specified, the attribute name will be used.
  *
  * @param  string  $attribute
  * @param  mixed   $value
  * @param  array   $parameters
  * @return bool
  */
 protected function validate_unique($attribute, $value, $parameters)
 {
     if (!isset($parameters[1])) {
         $parameters[1] = $attribute;
     }
     if (is_null($this->db)) {
         $this->db = DB::connection();
     }
     return $this->db->table($parameters[0])->where($parameters[1], '=', $value)->count() == 0;
 }
Esempio n. 2
0
 /**
  * Get a session database query.
  *
  * @return Query
  */
 private function table()
 {
     return $this->connection->table(Config::get('session.table'));
 }
Esempio n. 3
0
 /**
  * Get a session database query.
  *
  * @return Query
  */
 private function table()
 {
     return $this->connection->table(Config::$items['session']['table']);
 }