Illuminate\Database\Eloquent\Builder::first PHP Метод

first() публичный Метод

Execute the query and get the first result.
public first ( array $columns = ['*'] ) : Model | static | null
$columns array
Результат Model | static | null
    public function first($columns = ['*'])
    {
        return $this->take(1)->get($columns)->first();
    }

Usage Example

Пример #1
0
 /**
  * @inheritdoc
  */
 public function getByCredentials(array $credentials)
 {
     foreach ($credentials as $key => $value) {
         if (strpos($key, 'password') === false) {
             $this->queryBuilder->where($key, $value);
         }
     }
     return $this->queryBuilder->first();
 }
All Usage Examples Of Illuminate\Database\Eloquent\Builder::first