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